radv: Return VK_NOT_READY if the query results are not available.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 11 Apr 2017 21:56:42 +0000 (23:56 +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 9f54287c363cfb1efb3e9fe44688e0d695513afd..bd293b58e69949d44ccdd6e1ea33fedb0dece60c 100644 (file)
@@ -910,6 +910,12 @@ VkResult radv_GetQueryPoolResults(
                        break;
                }
                case VK_QUERY_TYPE_PIPELINE_STATISTICS: {
+                       if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) {
+                               result = VK_NOT_READY;
+                               break;
+
+                       }
+
                        const uint64_t *start = (uint64_t*)src;
                        const uint64_t *stop = (uint64_t*)(src + pipelinestat_block_size);
                        if (flags & VK_QUERY_RESULT_64_BIT) {