mesa/src/gallium/include/pipe
Kenneth Graunke d644698b44 gallium: Add the ability to query a single pipeline statistics counter
Gallium historically has treated pipeline statistics queries as a single
query, PIPE_QUERY_PIPELINE_STATISTICS, which returns a block of 11
values.  This was originally patterned after the D3D1x API.  Much later,
Brian introduced an OpenGL extension that exposed these counters - but
it exposes 11 separate queries, each of which returns a single value.

Today, st/mesa simply queries all 11 values, and returns a single value.
While pipeline statistics counters aren't typically performance
critical, this is still not a great fit.  A D3D1x->GL translator might
request all 11 counters by creating 11 separate GL queries...which
Gallium would map to reads of all 11 values each time, resulting in a
total 121 counter reads.  That's not ideal.

This patch adds a new cap, PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE,
and corresponding query type PIPE_QUERY_PIPELINE_STATISTICS_SINGLE.
When calling create_query(), q->index should be set to one of the
PIPE_STAT_QUERY_* enums to select a counter.  Unlike the block query,
this returns the value in pipe_query_result::u64 (as it's a single
value) instead of the pipe_query_data_pipeline_statistics group.

We update st/mesa to expose ARB_pipeline_statistics_query if either
capability is set, preferring the new SINGLE variant when available.

Thanks to Roland, Ilia, and Marek for helping me sort this out.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2019-01-15 11:43:04 -08:00
..
p_compiler.h util: move ALWAYS_INLINE macro to util/macro.h 2017-05-09 11:21:03 +10:00
p_config.h Revert "gallium: remove unused PIPE_CC_GCC_VERSION" 2017-05-24 11:33:46 -06:00
p_context.h gallium: fix typo 2018-12-07 13:49:21 -05:00
p_defines.h gallium: Add the ability to query a single pipeline statistics counter 2019-01-15 11:43:04 -08:00
p_format.h Gallium: Add format PIPE_FORMAT_R8_SRGB 2018-11-02 11:52:44 +01:00
p_screen.h gallium: add storage_sample_count parameter into is_format_supported 2018-07-31 18:28:41 -04:00
p_shader_tokens.h tgsi: add ATOMFADD operation 2018-12-26 20:04:57 -05:00
p_state.h gallium: Add new PIPE_CAP_SURFACE_SAMPLE_COUNT 2018-12-06 16:55:43 -08:00
p_video_codec.h Remove wrongly repeated words in comments 2016-06-23 13:55:03 -07:00
p_video_enums.h vl: add VP9 profile2 support 2018-04-12 11:15:13 -04:00
p_video_state.h vl: add VP9 picture description 2018-04-12 11:15:12 -04:00