Skip to content

Commit

Permalink
Fix VK_KHR_separate_depth_stencil_layouts (#1068)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mikes-lunarg authored May 26, 2022
1 parent 3ef9331 commit c05bbcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gapis/api/vulkan/api/renderpass_framebuffer.api
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,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,
Expand All @@ -413,14 +413,15 @@ 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,
)
}
}
}
}
renderPass.AttachmentDescriptions[i] = attachmentDescription
}

subpasses := info.pSubpasses[0:info.subpassCount]
Expand Down

0 comments on commit c05bbcf

Please sign in to comment.