Mesa (master): r300g: do not track whether occlusion queries have been flushed

Marek Olšák mareko at kemper.freedesktop.org
Mon Feb 14 22:59:19 UTC 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Feb 14 23:33:06 2011 +0100

r300g: do not track whether occlusion queries have been flushed

The winsys takes care of flushing automatically.

---

 src/gallium/drivers/r300/r300_context.h |    2 --
 src/gallium/drivers/r300/r300_emit.c    |    1 -
 src/gallium/drivers/r300/r300_flush.c   |    6 ------
 src/gallium/drivers/r300/r300_query.c   |   14 +++++---------
 4 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 6e940b4..58a7129 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -268,8 +268,6 @@ struct r300_query {
     /* How many results have been written, in dwords. It's incremented
      * after end_query and flush. */
     unsigned num_results;
-    /* if we've flushed the query */
-    boolean flushed;
     /* if begin has been emitted */
     boolean begin_emitted;
 
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 6ded868..bd864b9 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -559,7 +559,6 @@ void r300_emit_query_start(struct r300_context *r300, unsigned size, void*state)
     OUT_CS_REG(R300_ZB_ZPASS_DATA, 0);
     END_CS;
     query->begin_emitted = TRUE;
-    query->flushed = FALSE;
 }
 
 static void r300_emit_query_end_frag_pipes(struct r300_context *r300,
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index 1e80f80..0db1365 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -36,7 +36,6 @@ static void r300_flush(struct pipe_context* pipe,
                        struct pipe_fence_handle** fence)
 {
     struct r300_context *r300 = r300_context(pipe);
-    struct r300_query *query;
     struct r300_atom *atom;
     struct r300_fence **rfence = (struct r300_fence**)fence;
 
@@ -76,11 +75,6 @@ static void r300_flush(struct pipe_context* pipe,
         r300->rws->cs_flush(r300->cs);
     }
 
-    /* reset flushed query */
-    foreach(query, &r300->query_list) {
-        query->flushed = TRUE;
-    }
-
     /* Create a new fence. */
     if (rfence) {
         *rfence = CALLOC_STRUCT(r300_fence);
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index da871dc..717485f 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -127,16 +127,12 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
 {
     struct r300_context* r300 = r300_context(pipe);
     struct r300_query *q = r300_query(query);
-    unsigned flags, i;
+    unsigned i;
     uint32_t temp, *map;
-    uint64_t *result = (uint64_t*)vresult;
-
-    if (!q->flushed)
-        pipe->flush(pipe, 0, NULL);
-
-    flags = PIPE_TRANSFER_READ | (!wait ? PIPE_TRANSFER_DONTBLOCK : 0);
 
-    map = r300->rws->buffer_map(q->buf, r300->cs, flags);
+    map = r300->rws->buffer_map(q->buf, r300->cs,
+                                PIPE_TRANSFER_READ |
+                                (!wait ? PIPE_TRANSFER_DONTBLOCK : 0));
     if (!map)
         return FALSE;
 
@@ -149,7 +145,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
 
     r300->rws->buffer_unmap(q->buf);
 
-    *result = temp;
+    *((uint64_t*)vresult) = temp;
     return TRUE;
 }
 




More information about the mesa-commit mailing list