From 864ea81dcf24f64011ccdbbbd2e8f7b672a7113a Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 4 Mar 2025 14:42:49 +0100 Subject: [PATCH] panvk/csf: Set invalidate_inherited_ctx only if the render pass is inherited Secondary command buffers don't necessarily inherit their render context. If we flush draws, we should only set invalidate_inherited_ctx when the render context is inherited, otherwise is messes up with the primary command buffer state. Signed-off-by: Boris Brezillon Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: --- src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c b/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c index 9a77a88c6fd..4bf2e2798dc 100644 --- a/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c +++ b/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c @@ -2578,7 +2578,8 @@ panvk_per_arch(cmd_flush_draws)(struct panvk_cmd_buffer *cmdbuf) /* We inherited the render context, and need to let the primary command * buffer know that it's changed. */ - cmdbuf->state.gfx.render.invalidate_inherited_ctx = true; + cmdbuf->state.gfx.render.invalidate_inherited_ctx = + inherits_render_ctx(cmdbuf); /* Re-emit the FB/Tiler descs if we inherited them. */ if (inherits_render_ctx(cmdbuf))