pvr: Use correct index when writing query availability data

The availability data would be written to a different location in
the user provided buffer depending on whether the query for a given
index was available. Fix this by using fixed indicies when writing
the query and availability data.

Fixes conformance failures seen in the
dEQP-VK.query_pool.occlusion_query.get_reset_* test group when
implementing VK_EXT_host_query_reset.

Fixes: 279c7c6d5a ("pvr: Implement vkGetQueryPoolResults API.")
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25116>
This commit is contained in:
Vlad Schiller
2023-09-04 12:24:05 +01:00
committed by Marge Bot
parent 210f1e14d5
commit ca9734c223

View File

@@ -224,7 +224,6 @@ VkResult pvr_GetQueryPoolResults(VkDevice _device,
for (uint32_t i = 0; i < queryCount; i++) {
bool is_available = pvr_query_is_available(pool, firstQuery + i);
uint64_t count = 0;
uint32_t idx = 0;
if (flags & VK_QUERY_RESULT_WAIT_BIT && !is_available) {
result = pvr_wait_for_available(device, pool, firstQuery + i);
@@ -238,12 +237,12 @@ VkResult pvr_GetQueryPoolResults(VkDevice _device,
count += query_results[pool->result_stride * j + firstQuery + i];
if (is_available || (flags & VK_QUERY_RESULT_PARTIAL_BIT))
pvr_write_query_to_buffer(data, flags, idx++, count);
pvr_write_query_to_buffer(data, flags, 0, count);
else
result = VK_NOT_READY;
if (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)
pvr_write_query_to_buffer(data, flags, idx++, is_available);
pvr_write_query_to_buffer(data, flags, 1, is_available);
data += stride;
}