anv: reset query pools using blorp

Previously we used PC to set query data to 0 during
CmdResetQueryPool. This was slow when clearing large query pools.
Switching to blorp to clear pools is faster for large query pools.

Red Dead Redemption 2: +1.5% speedup

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
This commit is contained in:
Felix DeGrood
2023-03-22 22:08:09 +00:00
committed by Marge Bot
parent bb49610973
commit 4dc7256bf9
5 changed files with 134 additions and 21 deletions

View File

@@ -1029,6 +1029,7 @@ struct anv_instance {
bool fp64_workaround_enabled;
float lower_depth_range_rate;
unsigned generated_indirect_threshold;
unsigned query_clear_with_blorp_threshold;
/* HW workarounds */
bool no_16bit;
@@ -2085,6 +2086,11 @@ enum anv_pipe_bits {
* implement a workaround for Gfx9.
*/
ANV_PIPE_POST_SYNC_BIT = (1 << 25),
/* This bit does not exist directly in PIPE_CONTROL. It means that render
* target operations related to clearing of queries are ongoing.
*/
ANV_PIPE_QUERY_CLEARS_BIT = (1 << 26),
};
#define ANV_PIPE_FLUSH_BITS ( \
@@ -2127,6 +2133,20 @@ enum anv_pipe_bits {
#define ANV_PIPE_GPGPU_BITS ( \
(GFX_VERx10 >= 125 ? ANV_PIPE_UNTYPED_DATAPORT_CACHE_FLUSH_BIT : 0))
/* Things we need to flush before accessing query data using the command
* streamer.
*
* Prior to DG2 experiments show that the command streamer is not coherent
* with the tile cache so we need to flush it to make any data visible to CS.
*
* Otherwise we want to flush the RT cache which is where blorp writes, either
* for clearing the query buffer or for clearing the destination buffer in
* vkCopyQueryPoolResults().
*/
#define ANV_PIPE_QUERY_FLUSH_BITS ( \
(GFX_VERx10 < 125 ? ANV_PIPE_TILE_CACHE_FLUSH_BIT : 0) | \
ANV_PIPE_RENDER_TARGET_CACHE_FLUSH_BIT)
enum intel_ds_stall_flag
anv_pipe_flush_bit_to_ds_stall_flag(enum anv_pipe_bits bits);