From: Samuel Pitoiset Date: Wed, 22 May 2019 15:46:33 +0000 (+0200) Subject: radv: tidy up GetQueryPoolResults for occlusion queries X-Git-Tag: upstream/19.3.0~6082 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d2e7954c3628d7002ef2363484d04bd7933fab1;p=platform%2Fupstream%2Fmesa.git radv: tidy up GetQueryPoolResults for occlusion queries Just move the block that checks the availability bit into the switch like other query types. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c index 0bc7f83..c0f470d 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;