[Mesa-dev] [PATCH 2/2] panfrost: Implement PIPE_QUERY_OCCLUSION_COUNTER

Alyssa Rosenzweig alyssa at rosenzweig.io
Thu Feb 14 02:52:27 UTC 2019


Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
 src/gallium/drivers/panfrost/pan_context.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 73e7d4aaa8f..e51ca8f3982 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2495,6 +2495,7 @@ panfrost_begin_query(struct pipe_context *pipe, struct pipe_query *q)
         struct panfrost_query *query = (struct panfrost_query *) q;
 
         switch (query->type) {
+                case PIPE_QUERY_OCCLUSION_COUNTER:
                 case PIPE_QUERY_OCCLUSION_PREDICATE:
                 case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
                 {
@@ -2537,13 +2538,19 @@ panfrost_get_query_result(struct pipe_context *pipe,
         panfrost_flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME);
 
         switch (query->type) {
+                case PIPE_QUERY_OCCLUSION_COUNTER:
                 case PIPE_QUERY_OCCLUSION_PREDICATE:
                 case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE: {
                         /* Read back the query results */
                         unsigned *result = (unsigned *) query->transfer.cpu;
                         unsigned passed = *result;
 
-                        vresult->b = !!passed;
+                        if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) {
+                                vresult->u64 = passed;
+                        } else {
+                                vresult->b = !!passed;
+                        }
+
                         break;
                 }
                 default:
-- 
2.20.1



More information about the mesa-dev mailing list