Mesa (master): st/mesa: flush bitmap cache on query and conditional render boundaries

Brian Paul brianp at kemper.freedesktop.org
Wed Jul 13 17:58:49 UTC 2011


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

Author: Vadim Girlin <vadimgirlin at gmail.com>
Date:   Wed Jul 13 09:01:04 2011 +0400

st/mesa: flush bitmap cache on query and conditional render boundaries

Bitmap caching shouldn't affect the results of the queries and
conditional render.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
Signed-off-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/state_tracker/st_cb_condrender.c |    5 +++++
 src/mesa/state_tracker/st_cb_queryobj.c   |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_condrender.c b/src/mesa/state_tracker/st_cb_condrender.c
index 64c6c11..1ced560 100644
--- a/src/mesa/state_tracker/st_cb_condrender.c
+++ b/src/mesa/state_tracker/st_cb_condrender.c
@@ -41,6 +41,7 @@
 #include "st_context.h"
 #include "st_cb_queryobj.h"
 #include "st_cb_condrender.h"
+#include "st_cb_bitmap.h"
 
 
 /**
@@ -55,6 +56,8 @@ st_BeginConditionalRender(struct gl_context *ctx, struct gl_query_object *q,
    struct pipe_context *pipe = st->pipe;
    uint m;
 
+   st_flush_bitmap_cache(st);
+
    switch (mode) {
    case GL_QUERY_WAIT:
       m = PIPE_RENDER_COND_WAIT;
@@ -90,6 +93,8 @@ st_EndConditionalRender(struct gl_context *ctx, struct gl_query_object *q)
    struct pipe_context *pipe = st->pipe;
    (void) q;
 
+   st_flush_bitmap_cache(st);
+
    pipe->render_condition(pipe, NULL, 0);
    st->render_condition = NULL;
 }
diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c
index d0ac253..0574996 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -41,6 +41,7 @@
 #include "pipe/p_defines.h"
 #include "st_context.h"
 #include "st_cb_queryobj.h"
+#include "st_cb_bitmap.h"
 
 
 #if FEATURE_queryobj
@@ -83,6 +84,8 @@ st_BeginQuery(struct gl_context *ctx, struct gl_query_object *q)
    struct st_query_object *stq = st_query_object(q);
    unsigned type;
 
+   st_flush_bitmap_cache(st_context(ctx));
+
    /* convert GL query type to Gallium query type */
    switch (q->Target) {
    case GL_ANY_SAMPLES_PASSED:
@@ -128,6 +131,8 @@ st_EndQuery(struct gl_context *ctx, struct gl_query_object *q)
    struct pipe_context *pipe = st_context(ctx)->pipe;
    struct st_query_object *stq = st_query_object(q);
 
+   st_flush_bitmap_cache(st_context(ctx));
+
    pipe->end_query(pipe, stq->pq);
 }
 




More information about the mesa-commit mailing list