Mesa (master): trace: If either shader is disabled don't draw

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Sat May 16 00:52:26 UTC 2009


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

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Fri May 15 05:59:24 2009 +0200

trace: If either shader is disabled don't draw

---

 src/gallium/drivers/trace/tr_context.c |   13 +++++++++++++
 src/gallium/drivers/trace/tr_context.h |    6 ++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index dee9ac5..e51af24 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -121,6 +121,9 @@ trace_context_draw_arrays(struct pipe_context *_pipe,
    struct pipe_context *pipe = tr_ctx->pipe;
    boolean result;
 
+   if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
+      return 0;
+
    trace_dump_call_begin("pipe_context", "draw_arrays");
 
    trace_dump_arg(ptr, pipe);
@@ -150,6 +153,9 @@ trace_context_draw_elements(struct pipe_context *_pipe,
    struct pipe_buffer *indexBuffer = tr_buf->buffer;
    boolean result;
 
+   if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
+      return 0;
+
    trace_screen_user_buffer_update(_pipe->screen, indexBuffer);
 
    trace_dump_call_begin("pipe_context", "draw_elements");
@@ -187,6 +193,9 @@ trace_context_draw_range_elements(struct pipe_context *_pipe,
    struct pipe_buffer *indexBuffer = tr_buf->buffer;
    boolean result;
 
+   if (tr_ctx->curr.fs->disabled || tr_ctx->curr.vs->disabled)
+      return 0;
+
    trace_screen_user_buffer_update(_pipe->screen, indexBuffer);
 
    trace_dump_call_begin("pipe_context", "draw_range_elements");
@@ -593,6 +602,8 @@ trace_context_bind_fs_state(struct pipe_context *_pipe,
    trace_dump_arg(ptr, pipe);
    trace_dump_arg(ptr, state);
 
+   tr_ctx->curr.fs = tr_shdr;
+
    if (tr_shdr && tr_shdr->replaced)
       state = tr_shdr->replaced;
 
@@ -663,6 +674,8 @@ trace_context_bind_vs_state(struct pipe_context *_pipe,
    trace_dump_arg(ptr, pipe);
    trace_dump_arg(ptr, state);
 
+   tr_ctx->curr.vs = tr_shdr;
+
    if (tr_shdr && tr_shdr->replaced)
       state = tr_shdr->replaced;
 
diff --git a/src/gallium/drivers/trace/tr_context.h b/src/gallium/drivers/trace/tr_context.h
index a7da7b9..86827f9 100644
--- a/src/gallium/drivers/trace/tr_context.h
+++ b/src/gallium/drivers/trace/tr_context.h
@@ -46,6 +46,12 @@ struct trace_context
 
    struct pipe_context *pipe;
 
+   /* current state */
+   struct {
+      struct trace_shader *fs;
+      struct trace_shader *vs;
+   } curr;
+
    /* for list on screen */
    struct tr_list list;
 




More information about the mesa-commit mailing list