pvr: finalize query_indices array after ending last sub_cmd

The last sub_cmd in the command buffer could be a graphics one, and when
ending a graphics sub_cmd, the query_indices array will be checked to
know whether a occlusion query starts during this graphics sub_cmd.

Finalize the query_indices array after ending the last sub_cmd,
otherwise the check for query initiation may have a false negative
result.

Fixes the `dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.
random.seed6` test case.

Fixes: 2b1992a000 ("pvr: Implement vkCmdBeginQuery API.")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40854>
This commit is contained in:
Icenowy Zheng 2026-04-08 23:48:07 +08:00 committed by Marge Bot
parent 7ccca9f972
commit 36f34a72c1
2 changed files with 2 additions and 3 deletions

View file

@ -130,7 +130,6 @@ dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed58_multiview,
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed59,Fail
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed59_multiview,Fail
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed5_multiview,Fail
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed6,Fail
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed60,Fail
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed60_multiview,Fail
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed61,Fail

View file

@ -9813,11 +9813,11 @@ VkResult PVR_PER_ARCH(EndCommandBuffer)(VkCommandBuffer commandBuffer)
/* TODO: We should be freeing all the resources, allocated for recording,
* here.
*/
util_dynarray_fini(&state->query_indices);
result = pvr_arch_cmd_buffer_end_sub_cmd(cmd_buffer);
if (result != VK_SUCCESS)
pvr_cmd_buffer_set_error_unwarned(cmd_buffer, result);
util_dynarray_fini(&state->query_indices);
return vk_command_buffer_end(&cmd_buffer->vk);
}