diff options
author | Samuel Iglesias Gonsálvez <[email protected]> | 2019-03-21 17:43:56 +0100 |
---|---|---|
committer | Samuel Iglesias Gonsálvez <[email protected]> | 2019-03-25 08:21:22 +0100 |
commit | 01cf39003517c6842ad8684e5ba30552d54e3570 (patch) | |
tree | 4efe4d2887c29ad903cd89d5ab249cf581b2b9ae /src/amd/vulkan/radv_query.c | |
parent | cb3ea50ec2c429960e945d073315b61f78fc67b9 (diff) |
radv: write availability status vkGetQueryPoolResults() when the data is not available
If VK_QUERY_RESULT_WITH_AVAILABILY_BIT is set and
VK_QUERY_RESULT_WAIT_BIT and VK_QUERY_RESULT_PARTIAL_BIT are both not
set, we need return to VK_NOT_READY only and set the availability
status field for each query.
From Vulkan spec:
"If VK_QUERY_RESULT_WAIT_BIT and VK_QUERY_RESULT_PARTIAL_BIT are both
not set then no result values are written to pData for queries that are
in the unavailable state at the time of the call, and
vkGetQueryPoolResults returns VK_NOT_READY. However, availability state
is still written to pData for those queries if
VK_QUERY_RESULT_WITH_AVAILABILITY_BIT is set."
Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_query.c')
-rw-r--r-- | src/amd/vulkan/radv_query.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c index ae544b3df93..63a2ab773a8 100644 --- a/src/amd/vulkan/radv_query.c +++ b/src/amd/vulkan/radv_query.c @@ -1141,11 +1141,8 @@ VkResult radv_GetQueryPoolResults( available = *(uint64_t *)src != TIMESTAMP_NOT_READY; } - if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) { + if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) result = VK_NOT_READY; - break; - - } if (flags & VK_QUERY_RESULT_64_BIT) { if (available || (flags & VK_QUERY_RESULT_PARTIAL_BIT)) @@ -1178,11 +1175,8 @@ VkResult radv_GetQueryPoolResults( } } - if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) { + if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) result = VK_NOT_READY; - break; - - } if (flags & VK_QUERY_RESULT_64_BIT) { if (available || (flags & VK_QUERY_RESULT_PARTIAL_BIT)) @@ -1196,11 +1190,8 @@ VkResult radv_GetQueryPoolResults( break; } case VK_QUERY_TYPE_PIPELINE_STATISTICS: { - if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) { + 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); @@ -1247,10 +1238,8 @@ VkResult radv_GetQueryPoolResults( available = 0; } - if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) { + if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT)) result = VK_NOT_READY; - break; - } num_primitives_written = src64[3] - src64[1]; primitive_storage_needed = src64[2] - src64[0]; |