summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-02-14 02:50:30 +0000
committerAlyssa Rosenzweig <[email protected]>2019-02-15 07:46:02 +0000
commit5155bcf099b3de014d9644260da32ca292897bd3 (patch)
tree32ac4caae8991f5f800e476a119482a6be1f5052
parent2d22b5380cc0b66efb38f2d9cd09af8eab602011 (diff)
panfrost: Implement PIPE_QUERY_OCCLUSION_COUNTER
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 368b3b8759a..6272578bd5f 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2591,6 +2591,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:
{
@@ -2633,13 +2634,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: