tu: Don't patch GMEM for input attachments never in GMEM

This can happen if we resolve to a resolve attachment and then use that
resolve attachment as an input attachment in a later subpass. We don't
need to put it in GMEM, but it's still considered "written" because
input attachment reads need a dependency after the resolve.

MSRTSS input attachment tests effectively created such a scenario after
lowering to transient multisample attachments and inserting resolves.

Cc: mesa-stable
(cherry picked from commit d491a79027)

Conflicts:
	src/freedreno/vulkan/tu_pass.cc

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38167>
This commit is contained in:
Connor Abbott 2025-10-14 21:08:27 -04:00 committed by Dylan Baker
parent 2cfd3c52b2
commit 1c52a94428
2 changed files with 3 additions and 2 deletions

View file

@ -2514,7 +2514,7 @@
"description": "tu: Don't patch GMEM for input attachments never in GMEM",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -417,7 +417,8 @@ tu_render_pass_patch_input_gmem(struct tu_render_pass *pass)
uint32_t a = subpass->input_attachments[j].attachment;
if (a == VK_ATTACHMENT_UNUSED)
continue;
subpass->input_attachments[j].patch_input_gmem = written[a];
subpass->input_attachments[j].patch_input_gmem =
written[a] && pass->attachments[a].gmem;
}
for (unsigned j = 0; j < subpass->color_count; j++) {