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 <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35738>
This commit is contained in:
Christoph Pillmayer
2025-06-27 10:51:28 +00:00
committed by Marge Bot
parent 5cf456a028
commit a611ab7895
@@ -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