aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_context.c
diff options
context:
space:
mode:
authorElie Tournier <[email protected]>2020-03-20 11:50:06 +0000
committerMarge Bot <[email protected]>2020-05-07 10:21:50 +0000
commite705a2a9f48d3247557d468216c797dfb1758826 (patch)
treeb0f0f818057dc6aef0bb2a254255bffa351d9d4d /src/gallium/drivers/virgl/virgl_context.c
parenta6321c4b5a038db4682e49e098e9368df7ea18c4 (diff)
virgl: implement ARB_clear_texture
Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4345>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_context.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index 381a9c023a8..150eed8b68c 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -829,6 +829,24 @@ static void virgl_clear(struct pipe_context *ctx,
virgl_encode_clear(vctx, buffers, color, depth, stencil);
}
+static void virgl_clear_texture(struct pipe_context *ctx,
+ struct pipe_resource *res,
+ unsigned int level,
+ const struct pipe_box *box,
+ const void *data)
+{
+ struct virgl_context *vctx = virgl_context(ctx);
+ struct virgl_resource *vres = virgl_resource(res);
+
+ virgl_encode_clear_texture(vctx, vres, level, box, data);
+
+ /* Mark as dirty, since we are updating the host side resource
+ * without going through the corresponding guest side resource, and
+ * hence the two will diverge.
+ */
+ virgl_resource_dirty(vres, level);
+}
+
static void virgl_draw_vbo(struct pipe_context *ctx,
const struct pipe_draw_info *dinfo)
{
@@ -1498,6 +1516,7 @@ struct pipe_context *virgl_context_create(struct pipe_screen *pscreen,
vctx->base.launch_grid = virgl_launch_grid;
vctx->base.clear = virgl_clear;
+ vctx->base.clear_texture = virgl_clear_texture;
vctx->base.draw_vbo = virgl_draw_vbo;
vctx->base.flush = virgl_flush_from_st;
vctx->base.screen = pscreen;