tu: Fix buffer overflow optimizing MSRTT.

i is a subpass number, j is the attachment number we're trying to turn
into an attachment.

Fixes: f6c7f16322 ("tu: Implement VK_EXT_multisampled_render_to_single_sampled")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38684>
This commit is contained in:
Emma Anholt 2025-11-26 14:03:18 -08:00 committed by Marge Bot
parent 89da258e71
commit da5a555e40

View file

@ -649,7 +649,7 @@ tu_render_pass_opt_resolve_unresolve(struct tu_render_pass *pass)
*/
(j == subpass->color_count ?
subpass->depth_stencil_attachment.attachment :
subpass->color_attachments[i].attachment) >=
subpass->color_attachments[j].attachment) >=
pass->user_attachment_count &&
/* Check that it's the last use and the original attachment is
* not stored.