From 38e546c202333c70f4e0d761607257f9d1e46e61 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 5 Dec 2024 16:14:18 +0100 Subject: [PATCH] vulkan/state: Fix input attachment map state initialization/copy vk_dynamic_graphics_state_copy() is not copying the input attachment map, and color_attachment_count is not initialized in vk_dynamic_graphics_state_init_ial(). Signed-off-by: Boris Brezillon Acked-by: Mary Guillemard Reviewed-by: Faith Ekstrand Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Lionel Landwerlin Part-of: --- src/vulkan/runtime/vk_graphics_state.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vulkan/runtime/vk_graphics_state.c b/src/vulkan/runtime/vk_graphics_state.c index 1483da6cd23..550cc3f154c 100644 --- a/src/vulkan/runtime/vk_graphics_state.c +++ b/src/vulkan/runtime/vk_graphics_state.c @@ -1142,6 +1142,7 @@ vk_dynamic_graphics_state_init_ial(struct vk_dynamic_graphics_state *dst, const struct vk_input_attachment_location_state *ial) { if (IS_NEEDED(INPUT_ATTACHMENT_MAP)) { + dst->ial.color_attachment_count = ial->color_attachment_count; typed_memcpy(dst->ial.color_map, ial->color_map, MESA_VK_MAX_COLOR_ATTACHMENTS); dst->ial.depth_att = ial->depth_att; dst->ial.stencil_att = ial->stencil_att; @@ -2246,6 +2247,14 @@ vk_dynamic_graphics_state_copy(struct vk_dynamic_graphics_state *dst, COPY_IF_SET(RP_ATTACHMENTS, rp.attachments); + if (IS_SET_IN_SRC(INPUT_ATTACHMENT_MAP)) { + COPY_MEMBER(INPUT_ATTACHMENT_MAP, ial.color_attachment_count); + COPY_ARRAY(INPUT_ATTACHMENT_MAP, ial.color_map, + MESA_VK_MAX_COLOR_ATTACHMENTS); + COPY_MEMBER(INPUT_ATTACHMENT_MAP, ial.depth_att); + COPY_MEMBER(INPUT_ATTACHMENT_MAP, ial.stencil_att); + } + if (IS_SET_IN_SRC(COLOR_ATTACHMENT_MAP)) { COPY_ARRAY(COLOR_ATTACHMENT_MAP, cal.color_map, MESA_VK_MAX_COLOR_ATTACHMENTS);