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>
(cherry picked from commit d4ad50752f)
This commit is contained in:
Valentine Burley 2026-02-01 15:41:09 +01:00 committed by Eric Engestrom
parent b32cd7c265
commit db6cbb8410
2 changed files with 2 additions and 3 deletions

View file

@ -364,7 +364,7 @@
"description": "tu: Fix memory leak of patchpoints_ctx in dynamic rendering",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "0dd06c74d6531d25eaa01f23ebccf151c303335e",
"notes": null

View file

@ -7104,8 +7104,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 =
@ -7163,6 +7161,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);
}