From a611ab78958ecc3ba20f043bc8fd1c48ce1fd744 Mon Sep 17 00:00:00 2001 From: Christoph Pillmayer Date: Fri, 27 Jun 2025 10:51:28 +0000 Subject: [PATCH] panvk: Propagate occ query state from secondary to primary When we ExecuteCommands, we can have the following situation: secondary { beginQuery endQuery } primary { beginRendering executeCommands(secondary) endRendering } See dEQP-VK.query_pool.concurrent_queries.secondary_command_buffer. For the logic in EndRendering to correctly detect that an occlusion query has ended inside this render pass, the oq state has to be propagated back to the primary from the secondary. Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: --- src/panfrost/vulkan/csf/panvk_vX_cmd_buffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/panfrost/vulkan/csf/panvk_vX_cmd_buffer.c b/src/panfrost/vulkan/csf/panvk_vX_cmd_buffer.c index d94dd1905f5..7dd57ffbcfd 100644 --- a/src/panfrost/vulkan/csf/panvk_vX_cmd_buffer.c +++ b/src/panfrost/vulkan/csf/panvk_vX_cmd_buffer.c @@ -975,6 +975,11 @@ panvk_per_arch(CmdExecuteCommands)(VkCommandBuffer commandBuffer, primary->state.gfx.render.suspended = secondary->state.gfx.render.suspended; + /* Inherit the occlusion query state so that if the secondary contains + * begin/end, but the renderpass ends in the primary, the primary can + * correctly detect that an oq has ended in EndRendering. */ + primary->state.gfx.render.oq = secondary->state.gfx.render.oq; + /* If the render context we passed to the secondary command buffer got * invalidated, reset the FB/tiler descs and treat things as if we * suspended the render pass, since those descriptors have been