radv: Use correct size for availability flag.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 26 Feb 2017 21:36:10 +0000 (22:36 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 27 Feb 2017 00:33:10 +0000 (01:33 +0100)
Per spec, VK_QUERY_RESULT_64_BIT specifies the integer size and the
availability flag is an integer. We apparently handled this correctly
already for the copy to buffer case.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: 13.0 17.0 <mesa-stable@lists.freedesktop.org>
src/amd/vulkan/radv_query.c

index a2d0889fc0333de235fd0c3a13440306f9e4af80..288bd43a763bcaa643f64d1dbfdd63e41ca6b428 100644 (file)
@@ -205,8 +205,11 @@ VkResult radv_GetQueryPoolResults(
                }
 
                if (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) {
-                       *(uint32_t*)dest = available;
-                       dest += 4;
+                       if (flags & VK_QUERY_RESULT_64_BIT) {
+                               *(uint64_t*)dest = available;
+                       } else {
+                               *(uint32_t*)dest = available;
+                       }
                }
        }