From ea783a96b86b317ec253af95a8e4fcd6854ff5d9 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 4 Sep 2024 13:39:13 -0500 Subject: [PATCH] vulkan: Allow pColorAttachmentLocations == NULL in CmdSetRenderingAttachmentLocationsKHR() Fixes: fe19405c4640 ("vulkan/runtime: handle new dynamic states for attachment remapping") Reviewed-by: Alyssa Rosenzweig Part-of: --- src/vulkan/runtime/vk_graphics_state.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vulkan/runtime/vk_graphics_state.c b/src/vulkan/runtime/vk_graphics_state.c index 73be9e15a5b..416230a328f 100644 --- a/src/vulkan/runtime/vk_graphics_state.c +++ b/src/vulkan/runtime/vk_graphics_state.c @@ -1073,6 +1073,7 @@ vk_color_attachment_location_state_init(struct vk_color_attachment_location_stat for (uint32_t a = 0; a < MIN2(cal_info->colorAttachmentCount, MESA_VK_MAX_COLOR_ATTACHMENTS); a++) { cal->color_map[a] = + cal_info->pColorAttachmentLocations == NULL ? a : cal_info->pColorAttachmentLocations[a] == VK_ATTACHMENT_UNUSED ? MESA_VK_ATTACHMENT_UNUSED : cal_info->pColorAttachmentLocations[a]; } @@ -3103,6 +3104,7 @@ vk_common_CmdSetRenderingAttachmentLocationsKHR( assert(pLocationInfo->colorAttachmentCount <= MESA_VK_MAX_COLOR_ATTACHMENTS); for (uint32_t i = 0; i < pLocationInfo->colorAttachmentCount; i++) { uint8_t val = + pLocationInfo->pColorAttachmentLocations == NULL ? i : pLocationInfo->pColorAttachmentLocations[i] == VK_ATTACHMENT_UNUSED ? MESA_VK_ATTACHMENT_UNUSED : pLocationInfo->pColorAttachmentLocations[i]; SET_DYN_VALUE(dyn, COLOR_ATTACHMENT_MAP, cal.color_map[i], val);