From 832fdfd7f2e3dc2af136546153b7d0c8a3bd529d 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: (cherry picked from commit ea783a96b86b317ec253af95a8e4fcd6854ff5d9) --- .pick_status.json | 2 +- src/vulkan/runtime/vk_graphics_state.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 6d09a341fe1..fac72e02712 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -44,7 +44,7 @@ "description": "vulkan: Allow pColorAttachmentLocations == NULL in CmdSetRenderingAttachmentLocationsKHR()", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "fe19405c4640cdee88cf91a0faa13620090d5f70", "notes": null 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);