st/mesa: Only pause queries if there are any active queries to pause.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 9 Sep 2019 22:36:16 +0000 (15:36 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 11 Sep 2019 19:47:57 +0000 (19:47 +0000)
commit73e4f974b8396ce008a8f1b6d14e94a56f7c100f
tree8571e8d72f40114de309591909cfc5755cde6c98
parent2c1983f75767765686e8308a5841c5c26b5a0348
st/mesa: Only pause queries if there are any active queries to pause.

Previously, ReadPixels, PBO upload/download, and clears would call
cso_save_state with CSO_PAUSE_QUERIES, causing cso_context to call
pipe->set_active_query_state() twice for each operation.  This can
potentially cause driver work to enable/disable statistics counters.

But often, there are no queries happening which need to be paused.
By keeping a simple tally of active queries, we can skip this work.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_queryobj.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.h