From 66fcae5b1bb617bd4db8ad1752092dd88c9f849c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Briano?= Date: Mon, 15 Sep 2025 16:57:44 -0700 Subject: [PATCH] anv: fix FS output <-> attachment map building The arrays is first memset to OUTPUT_DISABLED, but if we iterate over MAX_RTS instead of the actual attachment count, we end up resetting any values not set by the application to the, probably identity, that comes from the state. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/genX_cmd_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/genX_cmd_draw.c b/src/intel/vulkan/genX_cmd_draw.c index a6d24c51a4f..9156384f9cd 100644 --- a/src/intel/vulkan/genX_cmd_draw.c +++ b/src/intel/vulkan/genX_cmd_draw.c @@ -665,7 +665,7 @@ cmd_buffer_maybe_flush_rt_writes(struct anv_cmd_buffer *cmd_buffer, /* Build a map of fragment color output to attachment */ uint8_t rt_to_att[MAX_RTS]; memset(rt_to_att, ANV_COLOR_OUTPUT_DISABLED, MAX_RTS); - for (uint32_t i = 0; i < MAX_RTS; i++) { + for (uint32_t i = 0; i < gfx->color_att_count; i++) { if (dyn->cal.color_map[i] != MESA_VK_ATTACHMENT_UNUSED) rt_to_att[dyn->cal.color_map[i]] = i; }