tu: Fix memory leak of patchpoints_ctx in dynamic rendering

tu_CmdBeginRendering was unconditionally allocating a new
patchpoints_ctx. When resuming a render pass chain, this overwrote the
existing context from the suspended pass, leaking it and all associated
FDM patchpoints.

Fixes: 0dd06c74d6 ("tu: Fix FDM patchpoint memory leak")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39639>
This commit is contained in:
Valentine Burley 2026-02-01 15:41:09 +01:00 committed by Marge Bot
parent ce4d338b0d
commit d4ad50752f

View file

@ -7300,8 +7300,6 @@ tu_CmdBeginRendering(VkCommandBuffer commandBuffer,
};
vk_cmd_set_rendering_attachment_locations(&cmd->vk, &ral_info);
cmd->patchpoints_ctx = ralloc_context(NULL);
a = cmd->dynamic_subpasses[0].fsr_attachment;
if (a != VK_ATTACHMENT_UNUSED) {
const VkRenderingFragmentShadingRateAttachmentInfoKHR *fsr_info =
@ -7362,6 +7360,7 @@ tu_CmdBeginRendering(VkCommandBuffer commandBuffer,
tu_fill_render_pass_state(&cmd->state.vk_rp, cmd->state.pass, cmd->state.subpass);
if (!resuming) {
cmd->patchpoints_ctx = ralloc_context(NULL);
tu_emit_renderpass_begin(cmd);
tu_emit_subpass_begin<CHIP>(cmd);
}