From 86d190e15852d680473fcdc6efe9a2d99a2f8f83 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Tue, 25 Nov 2025 17:55:02 +0100 Subject: [PATCH] nvk: Use rendering state attachment count when setting SET_CT_SELECT In case vk_color_attachment_location_state is in its default state, we would end up with an identity mapping for color_map resulting in 8 RTs being selected instead of what is really required. This now use the rendering state attachment count to properly emit SET_CT_SELECT. Found while debugging MRT on "dEQP-VK.shader_object.rendering.color_attachment_count_1.extra_attachment_after_1.none.none.same_color_formats.after.none.r16g16_sint_d32_sfloat_s8_uint" and while comparing with the proprietary driver. Signed-off-by: Mary Guillemard Fixes: 84de6c12b26 ("nvk: Emit SET_CT_SELECT based on the dynamic color location map") Reviewed-by: Mel Henning Reviewed-by: Faith Ekstrand Part-of: --- src/nouveau/vulkan/nvk_cmd_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_cmd_draw.c b/src/nouveau/vulkan/nvk_cmd_draw.c index 0bbc2a78962..35a59c618d3 100644 --- a/src/nouveau/vulkan/nvk_cmd_draw.c +++ b/src/nouveau/vulkan/nvk_cmd_draw.c @@ -3459,7 +3459,7 @@ nvk_flush_cb_state(struct nvk_cmd_buffer *cmd) int8_t loc_att[NVK_MAX_RTS] = { -1, -1, -1, -1, -1, -1, -1, -1}; uint8_t max_loc = 0; uint32_t att_used = 0; - for (uint8_t a = 0; a < MESA_VK_MAX_COLOR_ATTACHMENTS; a++) { + for (uint8_t a = 0; a < render->color_att_count; a++) { if (dyn->cal.color_map[a] == MESA_VK_ATTACHMENT_UNUSED) continue;