diff options
author | Kenneth Graunke <[email protected]> | 2018-09-28 11:21:47 +0200 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-01-15 11:43:04 -0800 |
commit | d644698b443b395dc878efdaf4201647b0ce69d6 (patch) | |
tree | e4e34caacff4b9be599c0679ee2f7419e0f68062 /src/gallium/include/pipe/p_defines.h | |
parent | f967273fb442de8281f8248e8c8bff5b13ab89e4 (diff) |
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 <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/gallium/include/pipe/p_defines.h')
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 4480b54eb2f..d76fadadfdf 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -563,6 +563,7 @@ enum pipe_query_type { PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE, PIPE_QUERY_GPU_FINISHED, PIPE_QUERY_PIPELINE_STATISTICS, + PIPE_QUERY_PIPELINE_STATISTICS_SINGLE, PIPE_QUERY_TYPES, /* start of driver queries, see pipe_screen::get_driver_query_info */ PIPE_QUERY_DRIVER_SPECIFIC = 256, @@ -851,6 +852,7 @@ enum pipe_cap PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET, PIPE_CAP_SURFACE_SAMPLE_COUNT, PIPE_CAP_TGSI_ATOMFADD, + PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE, }; /** |