aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50/nv50_query.c
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2019-02-04 22:57:06 -0500
committerIlia Mirkin <[email protected]>2019-02-06 19:35:57 -0500
commite00799d3dc0595dc3998dbf199ceec8b1eece966 (patch)
treee0a44996e5925d9a953606d51e4007fccc6aad51 /src/gallium/drivers/nouveau/nv50/nv50_query.c
parent162352e6711b3ceab114686f7a3248074339e7f7 (diff)
nv50,nvc0: use condition for occlusion queries when already complete
For the NO_WAIT variants, we would jump into the ALWAYS case for both nested and inverted occlusion queries. However if the query had previously completed, the application could reasonably expect that the render condition would follow that result. To resolve this, we remove the nesting distinction which unnecessarily created an imbalance between the regular and inverted cases (since there's no "zero" condition mode). We also use the proper comparison if we know that the query has completed (which could happen as a result of an earlier get_query_result call). Fixes KHR-GL45.conditional_render_inverted.functional Signed-off-by: Ilia Mirkin <[email protected]> Cc: 19.0 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_query.c')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_query.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query.c b/src/gallium/drivers/nouveau/nv50/nv50_query.c
index e30380cd84d..13088ebb5fa 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_query.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_query.c
@@ -98,12 +98,10 @@ nv50_render_condition(struct pipe_context *pipe,
case PIPE_QUERY_OCCLUSION_COUNTER:
case PIPE_QUERY_OCCLUSION_PREDICATE:
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
+ if (hq->state == NV50_HW_QUERY_STATE_READY)
+ wait = true;
if (likely(!condition)) {
- if (unlikely(hq->nesting))
- cond = wait ? NV50_3D_COND_MODE_NOT_EQUAL :
- NV50_3D_COND_MODE_ALWAYS;
- else
- cond = NV50_3D_COND_MODE_RES_NON_ZERO;
+ cond = wait ? NV50_3D_COND_MODE_NOT_EQUAL : NV50_3D_COND_MODE_ALWAYS;
} else {
cond = wait ? NV50_3D_COND_MODE_EQUAL : NV50_3D_COND_MODE_ALWAYS;
}
@@ -129,7 +127,7 @@ nv50_render_condition(struct pipe_context *pipe,
PUSH_SPACE(push, 9);
- if (wait) {
+ if (wait && hq->state != NV50_HW_QUERY_STATE_READY) {
BEGIN_NV04(push, SUBC_3D(NV50_GRAPH_SERIALIZE), 1);
PUSH_DATA (push, 0);
}