[Mesa-dev] [PATCH] radv: reset pending_reset_query when flushing caches

Alex Smith asmith at feralinteractive.com
Wed Dec 5 10:56:03 UTC 2018


Reviewed-by: Alex Smith <asmith at feralinteractive.com>

On Wed, 5 Dec 2018 at 10:32, Samuel Pitoiset <samuel.pitoiset at gmail.com>
wrote:

> If the driver used a compute shader for resetting a query pool,
> it should be completed when caches are flushed.
>
> This might reduce the number of stalls if operations are done
> between vkCmdResetQueryPool() and vkCmdBeginQuery()
> (or vkCmdWriteTimestamp()).
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_query.c    | 1 -
>  src/amd/vulkan/si_cmd_buffer.c | 5 +++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
> index e226bcef6a9..276cc1c42d7 100644
> --- a/src/amd/vulkan/radv_query.c
> +++ b/src/amd/vulkan/radv_query.c
> @@ -1447,7 +1447,6 @@ static void emit_query_flush(struct radv_cmd_buffer
> *cmd_buffer,
>                          * because we use a CP dma clear.
>                          */
>                         si_emit_cache_flush(cmd_buffer);
> -                       cmd_buffer->pending_reset_query = false;
>                 }
>         }
>  }
> diff --git a/src/amd/vulkan/si_cmd_buffer.c
> b/src/amd/vulkan/si_cmd_buffer.c
> index a9f25725415..2f57584bf82 100644
> --- a/src/amd/vulkan/si_cmd_buffer.c
> +++ b/src/amd/vulkan/si_cmd_buffer.c
> @@ -992,6 +992,11 @@ si_emit_cache_flush(struct radv_cmd_buffer
> *cmd_buffer)
>                 radv_cmd_buffer_trace_emit(cmd_buffer);
>
>         cmd_buffer->state.flush_bits = 0;
> +
> +       /* If the driver used a compute shader for resetting a query pool,
> it
> +        * should be finished at this point.
> +        */
> +       cmd_buffer->pending_reset_query = false;
>  }
>
>  /* sets the CP predication state using a boolean stored at va */
> --
> 2.19.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181205/837c500f/attachment-0001.html>


More information about the mesa-dev mailing list