VkAttachmentReference2
The VkAttachmentReference2
structure is defined as:
typedef struct VkAttachmentReference2 {
VkStructureType sType;
const void* pNext;
uint32_t attachment;
VkImageLayout layout;
VkImageAspectFlags aspectMask;
} VkAttachmentReference2;
or the equivalent
typedef VkAttachmentReference2 VkAttachmentReference2KHR;
sType
is a VkStructureType value identifying this structure.pNext
isNULL
or a pointer to a structure extending this structure.attachment
is either an integer value identifying an attachment at the corresponding index in VkRenderPassCreateInfo2::pAttachments
, orVK_ATTACHMENT_UNUSED
to signify that this attachment is not used.layout
is a VkImageLayout value specifying the layout the attachment uses during the subpass.aspectMask
is a mask of which aspect(s) can be accessed within the specified subpass as an input attachment.
Parameters defined by this structure with the same name as those in VkAttachmentReference have the identical effect to those parameters.
aspectMask
is ignored when this structure is used to describe anything
other than an input attachment reference.
If the separateDepthStencilLayouts
feature is enabled, and attachment
has a depth/stencil format, layout
can be set to a layout that only
specifies the layout of the depth aspect.
If layout
only specifies the layout of the depth aspect of the
attachment, the layout of the stencil aspect is specified by the
stencilLayout
member of a VkAttachmentReferenceStencilLayout
structure included in the pNext
chain.
Otherwise, layout
describes the layout for all relevant image aspects.
Valid Usage
VUID-VkAttachmentReference2-layout-03077
If attachment
is not VK_ATTACHMENT_UNUSED
, layout
must not be VK_IMAGE_LAYOUT_UNDEFINED
,
VK_IMAGE_LAYOUT_PREINITIALIZED
, or
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
VUID-VkAttachmentReference2-separateDepthStencilLayouts-03313
If the separateDepthStencilLayouts
feature is not enabled, and
attachment
is not VK_ATTACHMENT_UNUSED
, layout
must
not be VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL
,
VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
,
VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL
, or
VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
,
VUID-VkAttachmentReference2-synchronization2-06910
If the synchronization2
feature is
not enabled, layout
must not be
VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR
or
VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
VUID-VkAttachmentReference2-attachmentFeedbackLoopLayout-07311
If the attachmentFeedbackLoopLayout
feature is not enabled,
layout
must not be
VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
VUID-VkAttachmentReference2-dynamicRenderingLocalRead-09546
If the dynamicRenderingLocalRead
feature is not enabled, layout
must not be VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR
Valid Usage (Implicit)
VUID-VkAttachmentReference2-sType-sType
sType
must be VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2
VUID-VkAttachmentReference2-pNext-pNext
pNext
must be NULL
or a pointer to a valid instance of VkAttachmentReferenceStencilLayout
VUID-VkAttachmentReference2-sType-unique
The sType
value of each struct in the pNext
chain must be unique
VUID-VkAttachmentReference2-layout-parameter
layout
must be a valid VkImageLayout value