panvk: Close batch in CmdBeginRendering if already open

Because of the current event implementation, we can end up with an open
batch when entering CmdBeginRendering. As a result, we now reopen a
batch in that situation for now.

This fix crashes various crash in
"dEQP-VK.synchronization.op.single_queue.event.*".

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30782>
This commit is contained in:
Mary Guillemard
2024-08-22 09:39:17 +02:00
committed by Marge Bot
parent a88898a28f
commit 1d33aee197
+6 -2
View File
@@ -1759,8 +1759,12 @@ panvk_per_arch(CmdBeginRendering)(VkCommandBuffer commandBuffer,
bool resuming = cmdbuf->state.gfx.render.flags & VK_RENDERING_RESUMING_BIT;
/* If we're not resuming, cur_batch should be NULL. */
assert(!cmdbuf->cur_batch || resuming);
/* If we're not resuming, cur_batch should be NULL.
* However, this currently isn't true because of how events are implemented.
* XXX: Rewrite events to not close and open batch and add an assert here.
*/
if (cmdbuf->cur_batch && !resuming)
panvk_per_arch(cmd_close_batch)(cmdbuf);
/* The opened batch might have been disrupted by a compute job.
* We need to preload in that case. */