summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndres Rodriguez <[email protected]>2019-08-13 23:52:23 -0400
committerAndres Rodriguez <[email protected]>2019-08-17 05:53:51 -0400
commita410823b3ede9ff3bf7f56ffca295d1b3d04dbad (patch)
treeb2e1d7eed9aba07dd107a1e7db24b6861b743610 /src
parent7ee7b0ecbc0de098cba631b2ca0b3291c3817665 (diff)
radv: additional query fixes
Make sure we read the updated data from the gpu in cases where WAIT_BIT is not set. Cc: 19.1 19.2 <[email protected] Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_query.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index 1da8100b3a1..ba9723244ee 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -1124,10 +1124,11 @@ VkResult radv_GetQueryPoolResults(
switch (pool->type) {
case VK_QUERY_TYPE_TIMESTAMP: {
- available = *(uint64_t *)src != TIMESTAMP_NOT_READY;
+ volatile uint64_t const *src64 = (volatile uint64_t const *)src;
+ available = *src64 != TIMESTAMP_NOT_READY;
if (flags & VK_QUERY_RESULT_WAIT_BIT) {
- while (*(volatile uint64_t *)src == TIMESTAMP_NOT_READY)
+ while (*src64 == TIMESTAMP_NOT_READY)
;
available = true;
}
@@ -1137,11 +1138,11 @@ VkResult radv_GetQueryPoolResults(
if (flags & VK_QUERY_RESULT_64_BIT) {
if (available || (flags & VK_QUERY_RESULT_PARTIAL_BIT))
- *(uint64_t*)dest = *(uint64_t*)src;
+ *(uint64_t*)dest = *src64;
dest += 8;
} else {
if (available || (flags & VK_QUERY_RESULT_PARTIAL_BIT))
- *(uint32_t*)dest = *(uint32_t*)src;
+ *(uint32_t*)dest = *(volatile uint32_t*)src;
dest += 4;
}
break;
@@ -1189,13 +1190,13 @@ VkResult radv_GetQueryPoolResults(
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);
+ available = *(volatile uint32_t*)(pool->ptr + pool->availability_offset + 4 * query);
if (!available && !(flags & VK_QUERY_RESULT_PARTIAL_BIT))
result = VK_NOT_READY;
- const uint64_t *start = (uint64_t*)src;
- const uint64_t *stop = (uint64_t*)(src + pipelinestat_block_size);
+ const volatile uint64_t *start = (uint64_t*)src;
+ const volatile uint64_t *stop = (uint64_t*)(src + pipelinestat_block_size);
if (flags & VK_QUERY_RESULT_64_BIT) {
uint64_t *dst = (uint64_t*)dest;
dest += util_bitcount(pool->pipeline_stats_mask) * 8;