diff options
author | Samuel Pitoiset <[email protected]> | 2017-10-26 18:03:24 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-10-27 13:47:06 +0200 |
commit | a41e2e9cf5f865f21e32cac2ed2e25dd21a05119 (patch) | |
tree | 006d0970ae11ae01fdd9d376ac15beb455fe6d15 | |
parent | 0d61109bb75333b3e80fda69cbc5b75b0f3f9233 (diff) |
radv: allow to use a compute shader for resetting the query pool
Serious Sam Fusion 2017 uses a huge number of occlusion queries,
and the allocated query pool buffer is greater than 4096 bytes.
This slightly improves performance (tested in Ultra) from
117.2 FPS to 119.7 FPS (~+2%) on my RX480.
This also improves Talos, from 69 FPS to 72/73 FPS (~+5%).
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/vulkan/radv_query.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c index 06bf14ab680..16ffd846487 100644 --- a/src/amd/vulkan/radv_query.c +++ b/src/amd/vulkan/radv_query.c @@ -1058,16 +1058,18 @@ void radv_CmdResetQueryPool( { RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); RADV_FROM_HANDLE(radv_query_pool, pool, queryPool); - uint64_t va = radv_buffer_get_va(pool->bo); + struct radv_cmd_state *state = &cmd_buffer->state; - cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, pool->bo, 8); + state->flush_bits |= radv_fill_buffer(cmd_buffer, pool->bo, + firstQuery * pool->stride, + queryCount * pool->stride, 0); - si_cp_dma_clear_buffer(cmd_buffer, va + firstQuery * pool->stride, - queryCount * pool->stride, 0); if (pool->type == VK_QUERY_TYPE_TIMESTAMP || - pool->type == VK_QUERY_TYPE_PIPELINE_STATISTICS) - si_cp_dma_clear_buffer(cmd_buffer, va + pool->availability_offset + firstQuery * 4, - queryCount * 4, 0); + pool->type == VK_QUERY_TYPE_PIPELINE_STATISTICS) { + state->flush_bits |= radv_fill_buffer(cmd_buffer, pool->bo, + pool->availability_offset + firstQuery * 4, + queryCount * 4, 0); + } } void radv_CmdBeginQuery( |