radv: Set query availability bit even if we don't wait.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 11 Apr 2017 21:54:58 +0000 (23:54 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 12 Apr 2017 05:38:58 +0000 (07:38 +0200)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: 8475a14302e ("radv: Implement pipeline statistics queries.")
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
src/amd/vulkan/radv_query.c

index 07cb64041493a8ee64a7c42b6cf4aa8fc5998693..9f54287c363cfb1efb3e9fe44688e0d695513afd 100644 (file)
@@ -850,9 +850,10 @@ VkResult radv_GetQueryPoolResults(
                char *src = pool->ptr + query * pool->stride;
                uint32_t available;
 
-               if ((flags & VK_QUERY_RESULT_WAIT_BIT) && pool->type != VK_QUERY_TYPE_OCCLUSION) {
-                       while(!*(volatile uint32_t*)(pool->ptr + pool->availability_offset + 4 * query))
-                               ;
+               if (pool->type != VK_QUERY_TYPE_OCCLUSION) {
+                       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);
                }