[Mesa-dev] [PATCH] radv: allow to use a compute shader for resetting the query pool
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Tue Oct 24 19:00:39 UTC 2017
Can you run this through CTS? Kind of worried about cache flushes when
using a compute shader.
Otherwise r-b
On Tue, Oct 24, 2017 at 2:02 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> 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.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/amd/vulkan/radv_query.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
> index 06045d6b41..1711f604a6 100644
> --- a/src/amd/vulkan/radv_query.c
> +++ b/src/amd/vulkan/radv_query.c
> @@ -1058,16 +1058,15 @@ 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);
>
> - cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, pool->bo, 8);
> + 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);
> + radv_fill_buffer(cmd_buffer, pool->bo,
> + pool->availability_offset + firstQuery * 4,
> + queryCount * 4, 0);
> }
>
> void radv_CmdBeginQuery(
> --
> 2.14.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list