anv: set stencil layout for input attachments
If an input attachment has a stencil format, we need to set this.
v2: Fish out VkAttachmentReferenceStencilLayoutKHR from
VkAttachmentReference2KHR::pNext (Jason)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: c1c346f166
("anv: implement VK_KHR_separate_depth_stencil_layouts")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2891>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2891>
This commit is contained in:
parent
21bc16a723
commit
2cc14bd7b8
|
@ -294,6 +294,7 @@ VkResult anv_CreateRenderPass(
|
|||
.usage = VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
|
||||
.attachment = desc->pInputAttachments[j].attachment,
|
||||
.layout = desc->pInputAttachments[j].layout,
|
||||
.stencil_layout = desc->pInputAttachments[j].layout,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -471,10 +472,17 @@ VkResult anv_CreateRenderPass2KHR(
|
|||
subpass_attachments += desc->inputAttachmentCount;
|
||||
|
||||
for (uint32_t j = 0; j < desc->inputAttachmentCount; j++) {
|
||||
const VkAttachmentReferenceStencilLayoutKHR *stencil_layout =
|
||||
vk_find_struct_const(desc->pInputAttachments[j].pNext,
|
||||
ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR);
|
||||
|
||||
subpass->input_attachments[j] = (struct anv_subpass_attachment) {
|
||||
.usage = VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
|
||||
.attachment = desc->pInputAttachments[j].attachment,
|
||||
.layout = desc->pInputAttachments[j].layout,
|
||||
.stencil_layout = (stencil_layout ?
|
||||
stencil_layout->stencilLayout :
|
||||
desc->pInputAttachments[j].layout),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue