[Mesa-dev] [PATCH] radv: tidy up GetQueryPoolResults for occlusion queries

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun May 26 13:01:42 UTC 2019


r-b

On Wed, May 22, 2019 at 5:43 PM Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
> Just move the block that checks the availability bit into the
> switch like other query types.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_query.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
> index 0bc7f8390b6..c0f470da888 100644
> --- a/src/amd/vulkan/radv_query.c
> +++ b/src/amd/vulkan/radv_query.c
> @@ -1121,13 +1121,6 @@ VkResult radv_GetQueryPoolResults(
>                 char *src = pool->ptr + query * pool->stride;
>                 uint32_t available;
>
> -               if (pool->type == VK_QUERY_TYPE_PIPELINE_STATISTICS) {
> -                       if (flags & VK_QUERY_RESULT_WAIT_BIT)
> -                               while(!*(volatile uint32_t*)(pool->ptr + pool->availability_offset + 4 * query))
> -                                       ;
> -                       available = *(uint32_t*)(pool->ptr + pool->availability_offset + 4 * query);
> -               }
> -
>                 switch (pool->type) {
>                 case VK_QUERY_TYPE_TIMESTAMP: {
>                         available = *(uint64_t *)src != TIMESTAMP_NOT_READY;
> @@ -1187,6 +1180,11 @@ VkResult radv_GetQueryPoolResults(
>                         break;
>                 }
>                 case VK_QUERY_TYPE_PIPELINE_STATISTICS: {
> +                       if (flags & VK_QUERY_RESULT_WAIT_BIT)
> +                               while(!*(volatile uint32_t*)(pool->ptr + pool->availability_offset + 4 * query))
> +                                       ;
> +                       available = *(uint32_t*)(pool->ptr + pool->availability_offset + 4 * query);
> +
>                         if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT))
>                                 result = VK_NOT_READY;
>
> --
> 2.21.0
>
> _______________________________________________
> 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