Mesa (master): r300g: implement PIPE_QUERY_OCCLUSION_PREDICATE

Marek Olšák mareko at kemper.freedesktop.org
Thu Nov 10 21:54:08 UTC 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Thu Nov 10 21:18:10 2011 +0100

r300g: implement PIPE_QUERY_OCCLUSION_PREDICATE

---

 src/gallium/drivers/r300/r300_query.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index 55ec66d..c166717 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -36,7 +36,8 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe,
     struct r300_screen *r300screen = r300->screen;
     struct r300_query *q;
 
-    if (query_type != PIPE_QUERY_OCCLUSION_COUNTER) {
+    if (query_type != PIPE_QUERY_OCCLUSION_COUNTER &&
+        query_type != PIPE_QUERY_OCCLUSION_PREDICATE) {
         return NULL;
     }
 
@@ -139,6 +140,9 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
 
     r300->rws->buffer_unmap(q->buf);
 
+    if (q->type == PIPE_QUERY_OCCLUSION_PREDICATE) {
+        temp = temp != 0;
+    }
     *((uint64_t*)vresult) = temp;
     return TRUE;
 }




More information about the mesa-commit mailing list