If the attachment uses a color format, then loadOp and storeOp are used, and stencilLoadOp and stencilStoreOp are ignored. If the format has depth and/or stencil components, loadOp and storeOp apply only to the depth data, while stencilLoadOp and stencilStoreOp define how the stencil data is handled. loadOp and stencilLoadOp define the load operations for the attachment. storeOp and stencilStoreOp define the store operations for the attachment. If an attachment is not used by any subpass, loadOp, storeOp, stencilStoreOp, and stencilLoadOp will be ignored for that attachment, and no load or store ops will be performed. However, any transition specified by initialLayout and finalLayout will still be executed.
If flags includes ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT, then the attachment is treated as if it shares physical memory with another attachment in the same render pass. This information limits the ability of the implementation to reorder certain operations (like layout transitions and the loadOp) such that it is not improperly reordered against other uses of the same physical memory via a different attachment. This is described in more detail below.
If a render pass uses multiple attachments that alias the same device memory, those attachments must each include the ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT bit in their attachment description flags. Attachments aliasing the same memory occurs in multiple ways:
Render passes must include subpass dependencies (either directly or via a subpass dependency chain) between any two subpasses that operate on the same attachment or aliasing attachments and those subpass dependencies must include execution and memory dependencies separating uses of the aliases, if at least one of those subpasses writes to one of the aliases. These dependencies must not include the DEPENDENCY_BY_REGION_BIT if the aliases are views of distinct image subresources which overlap in memory.
Multiple attachments that alias the same memory must not be used in a single subpass. A given attachment index must not be used multiple times in a single subpass, with one exception: two subpass attachments can use the same attachment index if at least one use is as an input attachment and neither use is as a resolve or preserve attachment. In other words, the same view can be used simultaneously as an input and color or depth/stencil attachment, but must not be used as multiple color or depth/stencil attachments nor as resolve or preserve attachments.
If a set of attachments alias each other, then all except the first to be used in the render pass must use an initialLayout of IMAGE_LAYOUT_UNDEFINED, since the earlier uses of the other aliases make their contents undefined. Once an alias has been used and a different alias has been used after it, the first alias must not be used in any later subpasses. However, an application can assign the same image view to multiple aliasing attachment indices, which allows that image view to be used multiple times even if other aliases are used in between.
Once an attachment needs the ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT bit, there should be no additional cost of introducing additional aliases, and using these additional aliases may allow more efficient clearing of the attachments on multiple uses via ATTACHMENT_LOAD_OP_CLEAR.
format must not be FORMAT_UNDEFINEDformat includes a color or depth component and loadOp is ATTACHMENT_LOAD_OP_LOAD, then initialLayout must not be IMAGE_LAYOUT_UNDEFINEDfinalLayout must not be IMAGE_LAYOUT_UNDEFINED or IMAGE_LAYOUT_PREINITIALIZEDformat is a color format, initialLayout must not be IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMALformat is a depth/stencil format, initialLayout must not be IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMALformat is a color format, finalLayout must not be IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMALformat is a depth/stencil format, finalLayout must not be IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMALformat is a color format, initialLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMALformat is a color format, finalLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMALseparateDepthStencilLayouts feature is not enabled, initialLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,separateDepthStencilLayouts feature is not enabled, finalLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,format is a color format, initialLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALformat is a color format, finalLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALformat is a depth/stencil format which includes both depth and stencil components, initialLayout must not be IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALformat is a depth/stencil format which includes both depth and stencil components, finalLayout must not be IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALformat is a depth/stencil format which includes only the depth component, initialLayout must not be IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALformat is a depth/stencil format which includes only the depth component, finalLayout must not be IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALsynchronization2 feature is not enabled, initialLayout must not be IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHRsynchronization2 feature is not enabled, finalLayout must not be IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHRattachmentFeedbackLoopLayout feature is not enabled, initialLayout must not be IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXTattachmentFeedbackLoopLayout feature is not enabled, finalLayout must not be IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXTsamples must be a bit value that is set in imageCreateSampleCounts (as defined in Image Creation Limits) for the given formatformat includes a stencil component and stencilLoadOp is ATTACHMENT_LOAD_OP_LOAD, then initialLayout must not be IMAGE_LAYOUT_UNDEFINEDformat is a depth/stencil format which includes only the stencil component, initialLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALformat is a depth/stencil format which includes only the stencil component, finalLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALformat is a depth/stencil format which includes both depth and stencil components, initialLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALformat is a depth/stencil format which includes both depth and stencil components, finalLayout must not be IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALflags must be a valid combination of VkAttachmentDescriptionFlagBits valuesformat must be a valid VkFormat valuesamples must be a valid VkSampleCountFlagBits valueloadOp must be a valid VkAttachmentLoadOp valuestoreOp must be a valid VkAttachmentStoreOp valuestencilLoadOp must be a valid VkAttachmentLoadOp valuestencilStoreOp must be a valid VkAttachmentStoreOp valueinitialLayout must be a valid VkImageLayout valuefinalLayout must be a valid VkImageLayout value
struct VkAttachmentDescription {
VkAttachmentDescriptionFlags flags;
VkFormat format;
VkSampleCountFlagBits samples;
VkAttachmentLoadOp loadOp;
VkAttachmentStoreOp storeOp;
VkAttachmentLoadOp stencilLoadOp;
VkAttachmentStoreOp stencilStoreOp;
VkImageLayout initialLayout;
VkImageLayout finalLayout;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | VkAttachmentDescription.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | FINALLAYOUT
The struct member offsets. |
| public static final int | FLAGS
The struct member offsets. |
| public static final int | FORMAT
The struct member offsets. |
| public static final int | INITIALLAYOUT
The struct member offsets. |
| public static final int | LOADOP
The struct member offsets. |
| public static final int | SAMPLES
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | STENCILLOADOP
The struct member offsets. |
| public static final int | STENCILSTOREOP
The struct member offsets. |
| public static final int | STOREOP
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkAttachmentDescription(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkAttachmentDescription | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkAttachmentDescription. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription. | |
| public static VkAttachmentDescription. | |
| protected VkAttachmentDescription | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription | create(long address)
Returns a new |
| public static VkAttachmentDescription. | create(int
the buffer capacity capacity)Returns a new |
| public static VkAttachmentDescription. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription. | |
| public int | finalLayout()
the layout the attachment image subresource will be transitioned to when a render pass instance ends. |
| public VkAttachmentDescription | |
| public int | flags()
a bitmask of |
| public VkAttachmentDescription | |
| public int | format()
a |
| public VkAttachmentDescription | |
| public int | initialLayout()
the layout the attachment image subresource will be in when a render pass instance begins. |
| public VkAttachmentDescription | |
| public int | loadOp()
a |
| public VkAttachmentDescription | |
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkAttachmentDescription | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkAttachmentDescription. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription | |
| public static VkAttachmentDescription. | |
| public static VkAttachmentDescription. | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public int | |
| public VkAttachmentDescription | |
| public VkAttachmentDescription | set(int flags, int format, int samples, int loadOp, int storeOp, int stencilLoadOp, int stencilStoreOp, int initialLayout, int finalLayout)
Initializes this struct with the specified values. |
| public VkAttachmentDescription | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public int | stencilLoadOp()
a |
| public VkAttachmentDescription | |
| public int | stencilStoreOp()
a |
| public VkAttachmentDescription | |
| public int | storeOp()
a |
| public VkAttachmentDescription |