Mesa (master): gallium: remove occlusion_count flag from depth-stencil state

Keith Whitwell keithw at kemper.freedesktop.org
Sat May 16 16:28:42 UTC 2009


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

Author: Keith Whitwell <keith at tungstengraphics.com>
Date:   Sat May 16 17:25:26 2009 +0100

gallium: remove occlusion_count flag from depth-stencil state

Drivers can just keep track of whether they are within a query
by monitoring the begin/end query callbacks.  The flag adds no
information beyond that.

Only softpipe was examining this flag -- it has been fixed up
and retested with demos/arbocclude.

---

 src/gallium/drivers/softpipe/sp_context.h   |    1 +
 src/gallium/drivers/softpipe/sp_quad_pipe.c |    2 +-
 src/gallium/drivers/softpipe/sp_query.c     |    5 +++++
 src/gallium/drivers/trace/tr_dump_state.c   |    1 -
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 59d6df8..b89a729 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -92,6 +92,7 @@ struct softpipe_context {
     * queries.
     */
    uint64_t occlusion_count;
+   unsigned active_query_count;
 
    /** Mapped vertex buffers */
    ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS];
diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.c b/src/gallium/drivers/softpipe/sp_quad_pipe.c
index 892ef87..b5f69b7 100644
--- a/src/gallium/drivers/softpipe/sp_quad_pipe.c
+++ b/src/gallium/drivers/softpipe/sp_quad_pipe.c
@@ -80,7 +80,7 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
          sp_push_quad_first( sp, sp->quad[i].blend, i );
       }
 
-      if (sp->depth_stencil->depth.occlusion_count) {
+      if (sp->active_query_count) {
          sp_push_quad_first( sp, sp->quad[i].occlusion, i );
       }
 
diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
index 93dab23..379cf4a 100644
--- a/src/gallium/drivers/softpipe/sp_query.c
+++ b/src/gallium/drivers/softpipe/sp_query.c
@@ -34,6 +34,7 @@
 #include "util/u_memory.h"
 #include "sp_context.h"
 #include "sp_query.h"
+#include "sp_state.h"
 
 struct softpipe_query {
    uint64_t start;
@@ -69,6 +70,8 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
    struct softpipe_query *sq = softpipe_query(q);
    
    sq->start = softpipe->occlusion_count;
+   softpipe->active_query_count++;
+   softpipe->dirty |= SP_NEW_QUERY;
 }
 
 
@@ -78,7 +81,9 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
    struct softpipe_context *softpipe = softpipe_context( pipe );
    struct softpipe_query *sq = softpipe_query(q);
 
+   softpipe->active_query_count--;
    sq->end = softpipe->occlusion_count;
+   softpipe->dirty |= SP_NEW_QUERY;
 }
 
 
diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c
index 1b2b349..23a2473 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -271,7 +271,6 @@ void trace_dump_depth_stencil_alpha_state(const struct pipe_depth_stencil_alpha_
    trace_dump_member(bool, &state->depth, enabled);
    trace_dump_member(bool, &state->depth, writemask);
    trace_dump_member(uint, &state->depth, func);
-   trace_dump_member(bool, &state->depth, occlusion_count);
    trace_dump_struct_end();
    trace_dump_member_end();
 




More information about the mesa-commit mailing list