Mesa (master): trace: adapt to clear interface changes

Roland Scheidegger sroland at kemper.freedesktop.org
Thu Jun 3 15:47:35 UTC 2010


Module: Mesa
Branch: master
Commit: e4de4b0755daad72fb445a55d570f445c73aa11c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e4de4b0755daad72fb445a55d570f445c73aa11c

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Sat May 29 01:19:59 2010 +0200

trace: adapt to clear interface changes

---

 src/gallium/drivers/trace/tr_context.c |   78 +++++++++++++++++++++----------
 1 files changed, 53 insertions(+), 25 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index 5cc244d..e8ac33f 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1085,61 +1085,88 @@ trace_context_resource_copy_region(struct pipe_context *_pipe,
 
 
 static INLINE void
-trace_context_resource_fill_region(struct pipe_context *_pipe,
-                                   struct pipe_resource *dst,
-                                   struct pipe_subresource subdst,
-                                   unsigned dstx, unsigned dsty, unsigned dstz,
-                                   unsigned width, unsigned height,
-                                   unsigned value)
+trace_context_clear(struct pipe_context *_pipe,
+                    unsigned buffers,
+                    const float *rgba,
+                    double depth,
+                    unsigned stencil)
 {
    struct trace_context *tr_ctx = trace_context(_pipe);
    struct pipe_context *pipe = tr_ctx->pipe;
 
-   dst = trace_resource_unwrap(tr_ctx, dst);
+   trace_dump_call_begin("pipe_context", "clear");
+
+   trace_dump_arg(ptr, pipe);
+   trace_dump_arg(uint, buffers);
+   trace_dump_arg_array(float, rgba, 4);
+   trace_dump_arg(float, depth);
+   trace_dump_arg(uint, stencil);
+
+   pipe->clear(pipe, buffers, rgba, depth, stencil);
+
+   trace_dump_call_end();
+}
+
+
+static INLINE void
+trace_context_clearRT(struct pipe_context *_pipe,
+                      struct pipe_surface *dst,
+                      const float *rgba,
+                      unsigned dstx, unsigned dsty,
+                      unsigned width, unsigned height)
+{
+   struct trace_context *tr_ctx = trace_context(_pipe);
+   struct pipe_context *pipe = tr_ctx->pipe;
 
-   trace_dump_call_begin("pipe_context", "resource_fill_region");
+   dst = trace_surface_unwrap(tr_ctx, dst);
+
+   trace_dump_call_begin("pipe_context", "clearRT");
 
    trace_dump_arg(ptr, pipe);
    trace_dump_arg(ptr, dst);
-   trace_dump_arg_struct(subresource, subdst);
+   trace_dump_arg_array(float, rgba, 4);
    trace_dump_arg(uint, dstx);
    trace_dump_arg(uint, dsty);
-   trace_dump_arg(uint, dstz);
    trace_dump_arg(uint, width);
    trace_dump_arg(uint, height);
-   trace_dump_arg(uint, value);
 
-   pipe->resource_fill_region(pipe, dst, subdst, dstx, dsty, dstz,
-                              width, height, value);
+   pipe->clearRT(pipe, dst, rgba, dstx, dsty, width, height);
 
    trace_dump_call_end();
 }
 
-
 static INLINE void
-trace_context_clear(struct pipe_context *_pipe,
-                    unsigned buffers,
-                    const float *rgba,
-                    double depth,
-                    unsigned stencil)
+trace_context_clearDS(struct pipe_context *_pipe,
+                      struct pipe_surface *dst,
+                      unsigned clear_flags,
+                      double depth,
+                      unsigned stencil,
+                      unsigned dstx, unsigned dsty,
+                      unsigned width, unsigned height)
 {
    struct trace_context *tr_ctx = trace_context(_pipe);
    struct pipe_context *pipe = tr_ctx->pipe;
 
-   trace_dump_call_begin("pipe_context", "clear");
+   dst = trace_surface_unwrap(tr_ctx, dst);
+
+   trace_dump_call_begin("pipe_context", "clearDS");
 
    trace_dump_arg(ptr, pipe);
-   trace_dump_arg(uint, buffers);
-   trace_dump_arg_array(float, rgba, 4);
+   trace_dump_arg(ptr, dst);
+   trace_dump_arg(uint, clear_flags);
    trace_dump_arg(float, depth);
    trace_dump_arg(uint, stencil);
+   trace_dump_arg(uint, dstx);
+   trace_dump_arg(uint, dsty);
+   trace_dump_arg(uint, width);
+   trace_dump_arg(uint, height);
 
-   pipe->clear(pipe, buffers, rgba, depth, stencil);
+   pipe->clearDS(pipe, dst, clear_flags, depth, stencil,
+                 dstx, dsty, width, height);
 
    trace_dump_call_end();
 }
 
-
 static INLINE void
 trace_context_flush(struct pipe_context *_pipe,
                     unsigned flags,
@@ -1451,8 +1478,9 @@ trace_context_create(struct trace_screen *tr_scr,
    tr_ctx->base.sampler_view_destroy = trace_sampler_view_destroy;
    tr_ctx->base.set_vertex_buffers = trace_context_set_vertex_buffers;
    tr_ctx->base.resource_copy_region = trace_context_resource_copy_region;
-   tr_ctx->base.resource_fill_region = trace_context_resource_fill_region;
    tr_ctx->base.clear = trace_context_clear;
+   tr_ctx->base.clearRT = trace_context_clearRT;
+   tr_ctx->base.clearDS = trace_context_clearDS;
    tr_ctx->base.flush = trace_context_flush;
    tr_ctx->base.is_resource_referenced = trace_is_resource_referenced;
 




More information about the mesa-commit mailing list