[Mesa-dev] [PATCH 2/8] st/nine: Queries: Remove flush logic

Axel Davy axel.davy at ens.fr
Tue Dec 2 13:12:53 PST 2014


get_query_result flushes automatically, we don't need to flush.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/gallium/state_trackers/nine/query9.c | 13 +++++--------
 src/gallium/state_trackers/nine/query9.h |  1 -
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/gallium/state_trackers/nine/query9.c b/src/gallium/state_trackers/nine/query9.c
index 0cb3d2e..5e30144 100644
--- a/src/gallium/state_trackers/nine/query9.c
+++ b/src/gallium/state_trackers/nine/query9.c
@@ -212,15 +212,12 @@ NineQuery9_GetData( struct NineQuery9 *This,
     if (This->state == NINE_QUERY_STATE_FRESH)
         return S_OK;
 
+    /* Note: We ignore dwGetDataFlags, because get_query_result will
+     * flush automatically if needed */
+
     ok = pipe->get_query_result(pipe, This->pq, FALSE, &presult);
-    if (!ok) {
-        if (dwGetDataFlags) {
-            if (This->state != NINE_QUERY_STATE_FLUSHED)
-                pipe->flush(pipe, NULL, 0);
-            This->state = NINE_QUERY_STATE_FLUSHED;
-        }
-        return S_FALSE;
-    }
+
+    if (!ok) return S_FALSE;
 
     if (!dwSize)
         return S_OK;
diff --git a/src/gallium/state_trackers/nine/query9.h b/src/gallium/state_trackers/nine/query9.h
index f08393f..abd4352 100644
--- a/src/gallium/state_trackers/nine/query9.h
+++ b/src/gallium/state_trackers/nine/query9.h
@@ -30,7 +30,6 @@ enum nine_query_state
     NINE_QUERY_STATE_FRESH = 0,
     NINE_QUERY_STATE_RUNNING,
     NINE_QUERY_STATE_ENDED,
-    NINE_QUERY_STATE_FLUSHED
 };
 
 struct NineQuery9
-- 
2.1.0



More information about the mesa-dev mailing list