From 2290b35643e44b2f4653f789a912f7be574f9b90 Mon Sep 17 00:00:00 2001 From: Mike Schuchardt Date: Tue, 22 Mar 2022 20:02:10 -0700 Subject: [PATCH] Fix VK_KHR_separate_depth_stencil_layouts Even though the test app captured and replayed without issue, the state view showed that `VkAttachmentDescriptionStencilLayout` was not saved for the render passes that included it. This is caused by the map access operation returning a copy instead of a reference, making in-place modification of `renderPass.AttachmentDescriptions[j].StencilLayout` impossible. The solution here is to assign it to the map after processing the pNext chain. --- gapis/api/vulkan/api/renderpass_framebuffer.api | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gapis/api/vulkan/api/renderpass_framebuffer.api b/gapis/api/vulkan/api/renderpass_framebuffer.api index 5b1693b23..ac3a5b92e 100644 --- a/gapis/api/vulkan/api/renderpass_framebuffer.api +++ b/gapis/api/vulkan/api/renderpass_framebuffer.api @@ -366,7 +366,7 @@ sub ref!RenderPassObject createRenderPassObjectFromInfo2( attachments := info.pAttachments[0:info.attachmentCount] for i in (0 .. info.attachmentCount) { attachment := attachments[i] - renderPass.AttachmentDescriptions[i] = AttachmentDescription( + attachmentDescription := AttachmentDescription( Flags: attachment.flags, Format: attachment.format, Samples: attachment.samples, @@ -386,7 +386,7 @@ sub ref!RenderPassObject createRenderPassObjectFromInfo2( switch sType { case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: { ext := as!VkAttachmentDescriptionStencilLayout*(next.Ptr)[0] - renderPass.AttachmentDescriptions[j].StencilLayout = new!AttachmentDescriptionStencilLayout( + attachmentDescription.StencilLayout = new!AttachmentDescriptionStencilLayout( StencilInitialLayout: ext.stencilInitialLayout, StencilFinalLayout: ext.stencilFinalLayout, ) @@ -394,6 +394,7 @@ sub ref!RenderPassObject createRenderPassObjectFromInfo2( } } } + renderPass.AttachmentDescriptions[i] = attachmentDescription } subpasses := info.pSubpasses[0:info.subpassCount]