nv50,nvc0: use condition for occlusion queries when already complete
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 5 Feb 2019 03:57:06 +0000 (22:57 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 7 Feb 2019 00:35:57 +0000 (19:35 -0500)
commite00799d3dc0595dc3998dbf199ceec8b1eece966
treee0a44996e5925d9a953606d51e4007fccc6aad51
parent162352e6711b3ceab114686f7a3248074339e7f7
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 <imirkin@alum.mit.edu>
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/nv50/nv50_query.c
src/gallium/drivers/nouveau/nv50/nv50_query_hw.c
src/gallium/drivers/nouveau/nv50/nv50_query_hw.h
src/gallium/drivers/nouveau/nvc0/nvc0_query.c
src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.h