summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-02-04 12:48:06 -0500
committerIlia Mirkin <[email protected]>2016-02-09 11:59:35 -0500
commit0cb1dda36e1a651173fec48c151fd3d07eb8077f (patch)
tree4cacfec58020bcd5baff4bac3d071855ac5af52f
parent0d04ec2fd23f8b1baf62ea0ab8c7a86f23ada619 (diff)
nv30: add PIPE_QUERY_OCCLUSION_PREDICATE support
Signed-off-by: Ilia Mirkin <[email protected]>
-rw-r--r--src/gallium/drivers/nouveau/nv30/nv30_query.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_query.c b/src/gallium/drivers/nouveau/nv30/nv30_query.c
index 3980be9579a..75a4b0446fe 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_query.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_query.c
@@ -120,6 +120,7 @@ nv30_query_create(struct pipe_context *pipe, unsigned type, unsigned index)
q->report = 1;
break;
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
q->enable = NV30_3D_QUERY_ENABLE;
q->report = 1;
break;
@@ -203,7 +204,6 @@ nv30_query_result(struct pipe_context *pipe, struct pipe_query *pq,
struct nv30_query *q = nv30_query(pq);
volatile uint32_t *ntfy0 = nv30_ntfy(screen, q->qo[0]);
volatile uint32_t *ntfy1 = nv30_ntfy(screen, q->qo[1]);
- uint64_t *res64 = &result->u64;
if (ntfy1) {
while (ntfy1[3] & 0xff000000) {
@@ -227,7 +227,10 @@ nv30_query_result(struct pipe_context *pipe, struct pipe_query *pq,
nv30_query_object_del(screen, &q->qo[1]);
}
- *res64 = q->result;
+ if (q->type == PIPE_QUERY_OCCLUSION_PREDICATE)
+ result->b = !!q->result;
+ else
+ result->u64 = q->result;
return true;
}