mesa: treat unsupported queries as dummies
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 15 Nov 2022 14:41:22 +0000 (15:41 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Nov 2022 06:50:58 +0000 (06:50 +0000)
commit1b1e8873fe90e878f014140b3b6bd1e5dbfb5a4c
tree6104181e1f391508e0d52761d63077065d797576
parentc70eec86efd9ca2faa1f66fcaf42cc37360dcb5e
mesa: treat unsupported queries as dummies

It's legal in OpenGL to start a query even if the result will have zero
valid bits. It's not enough to just report zero bits, We need to also
prevent calling down into the driver with these invalid queries.

Because ARB_ES3_compatibility adds ANY_SAMPLES_PASSED and
ANY_SAMPLES_PASSED_CONSERVATIVE to the set of queries that support zero
bits, we also need to check for the corresponding indices.

Fixes: 0186e9e1c51 ("mesa: always support occlusion queries")
Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>
src/mesa/main/queryobj.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h