ddebug: implement clear_texture
authorMarek Olšák <marek.olsak@amd.com>
Tue, 28 Mar 2017 00:15:23 +0000 (02:15 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 30 Mar 2017 16:53:42 +0000 (18:53 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/ddebug/dd_draw.c
src/gallium/drivers/ddebug/dd_pipe.h

index e01d2aef800877d4a966369d22adfb075a609340..5cbc2b9e48cee3d3651b18a897d5710ddf3932d4 100644 (file)
@@ -450,6 +450,13 @@ dd_dump_clear_buffer(struct dd_draw_state *dstate, struct call_clear_buffer *inf
    fprintf(f, "\n");
 }
 
+static void
+dd_dump_clear_texture(struct dd_draw_state *dstate, FILE *f)
+{
+   fprintf(f, "%s:\n", __func__+8);
+   /* TODO */
+}
+
 static void
 dd_dump_clear_render_target(struct dd_draw_state *dstate, FILE *f)
 {
@@ -501,6 +508,9 @@ dd_dump_call(FILE *f, struct dd_draw_state *state, struct dd_call *call)
    case CALL_CLEAR_BUFFER:
       dd_dump_clear_buffer(state, &call->info.clear_buffer, f);
       break;
+   case CALL_CLEAR_TEXTURE:
+      dd_dump_clear_texture(state, f);
+      break;
    case CALL_CLEAR_RENDER_TARGET:
       dd_dump_clear_render_target(state, f);
       break;
@@ -619,6 +629,8 @@ dd_unreference_copy_of_call(struct dd_call *dst)
    case CALL_CLEAR_BUFFER:
       pipe_resource_reference(&dst->info.clear_buffer.res, NULL);
       break;
+   case CALL_CLEAR_TEXTURE:
+      break;
    case CALL_CLEAR_RENDER_TARGET:
       break;
    case CALL_CLEAR_DEPTH_STENCIL:
@@ -675,6 +687,8 @@ dd_copy_call(struct dd_call *dst, struct dd_call *src)
                               src->info.clear_buffer.res);
       dst->info.clear_buffer = src->info.clear_buffer;
       break;
+   case CALL_CLEAR_TEXTURE:
+      break;
    case CALL_CLEAR_RENDER_TARGET:
       break;
    case CALL_CLEAR_DEPTH_STENCIL:
@@ -1340,6 +1354,24 @@ dd_context_clear_buffer(struct pipe_context *_pipe, struct pipe_resource *res,
    dd_after_draw(dctx, &call);
 }
 
+static void
+dd_context_clear_texture(struct pipe_context *_pipe,
+                         struct pipe_resource *res,
+                         unsigned level,
+                         const struct pipe_box *box,
+                         const void *data)
+{
+   struct dd_context *dctx = dd_context(_pipe);
+   struct pipe_context *pipe = dctx->pipe;
+   struct dd_call call;
+
+   call.type = CALL_CLEAR_TEXTURE;
+
+   dd_before_draw(dctx);
+   pipe->clear_texture(pipe, res, level, box, data);
+   dd_after_draw(dctx, &call);
+}
+
 void
 dd_init_draw_functions(struct dd_context *dctx)
 {
@@ -1352,6 +1384,7 @@ dd_init_draw_functions(struct dd_context *dctx)
    CTX_INIT(clear_render_target);
    CTX_INIT(clear_depth_stencil);
    CTX_INIT(clear_buffer);
+   CTX_INIT(clear_texture);
    CTX_INIT(flush_resource);
    CTX_INIT(generate_mipmap);
 }
index deb1ab7334958a8d21dd39b5b99b91d57e9e9b6c..deae1f5bc3d1ac4adefaed1d12943935f5d7ed8a 100644 (file)
@@ -62,6 +62,7 @@ enum call_type
    CALL_FLUSH_RESOURCE,
    CALL_CLEAR,
    CALL_CLEAR_BUFFER,
+   CALL_CLEAR_TEXTURE,
    CALL_CLEAR_RENDER_TARGET,
    CALL_CLEAR_DEPTH_STENCIL,
    CALL_GENERATE_MIPMAP,