C Specification

The VkRenderingAttachmentInfoKHR structure is defined as:

// Provided by VK_KHR_dynamic_rendering
typedef struct VkRenderingAttachmentInfoKHR {
    VkStructureType          sType;
    const void*              pNext;
    VkImageView              imageView;
    VkImageLayout            imageLayout;
    VkResolveModeFlagBits    resolveMode;
    VkImageView              resolveImageView;
    VkImageLayout            resolveImageLayout;
    VkAttachmentLoadOp       loadOp;
    VkAttachmentStoreOp      storeOp;
    VkClearValue             clearValue;
} VkRenderingAttachmentInfoKHR;

Members

  • sType is the type of this structure.

  • pNext is NULL or a pointer to a structure extending this structure.

  • imageView is the image view that will be used for rendering.

  • imageLayout is the layout that imageView will be in during rendering.

  • resolveMode is a VkResolveModeFlagBits value defining how multisampled data written to imageView will be resolved.

  • resolveImageView is an image view used to write resolved multisample data at the end of rendering.

  • resolveImageLayout is the layout that resolveImageView will be in during rendering.

  • loadOp is a VkAttachmentLoadOp value specifying how the contents of imageView are treated at the start of the render pass instance.

  • storeOp is a VkAttachmentStoreOp value specifying how the contents of imageView are treated at the end of the render pass instance.

  • clearValue is a VkClearValue structure defining values used to clear imageView when loadOp is VK_ATTACHMENT_LOAD_OP_CLEAR.

Description

Values in imageView are loaded and stored according to the values of loadOp and storeOp, within the render area for each device specified in VkRenderingInfoKHR. If imageView is VK_NULL_HANDLE, other members of this structure are ignored; writes to this attachment will be discarded, and no load, store, or resolve operations will be performed.

If resolveMode is VK_RESOLVE_MODE_NONE, then resolveImageView is ignored. If resolveMode is not VK_RESOLVE_MODE_NONE, values in resolveImageView within the render area become undefined once rendering begins. At the end of rendering, the color values written to each pixel location in imageView will be resolved according to resolveMode and stored into the the same location in resolveImageView.

Note

The resolve mode and store operation are independent; it is valid to write both resolved and unresolved values, and equally valid to discard the unresolved values while writing the resolved ones.

Store and resolve operations are only performed at the end of a render pass instance that does not specify the VK_RENDERING_SUSPENDING_BIT_KHR flag.

Load operations are only performed at the beginning of a render pass instance that does not specify the VK_RENDERING_RESUMING_BIT_KHR flag.

Image contents at the end of a suspended render pass instance remain defined for access by a resuming render pass instance.

Valid Usage
  • VUID-VkRenderingAttachmentInfoKHR-imageView-06129
    If imageView is not VK_NULL_HANDLE and has a non-integer color format, resolveMode must be VK_RESOLVE_MODE_NONE or VK_RESOLVE_MODE_AVERAGE_BIT

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06130
    If imageView is not VK_NULL_HANDLE and has an integer color format, resolveMode must be VK_RESOLVE_MODE_NONE or VK_RESOLVE_MODE_SAMPLE_ZERO_BIT

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06132
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, imageView must not have a sample count of VK_SAMPLE_COUNT_1_BIT

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06133
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageView must have a sample count of VK_SAMPLE_COUNT_1_BIT

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06134
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, imageView and resolveImageView must have the same VkFormat

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06135
    If imageView is not VK_NULL_HANDLE, layout must not be VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, or VK_IMAGE_LAYOUT_PREINITIALIZED

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06136
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageLayout must not be VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, or VK_IMAGE_LAYOUT_PREINITIALIZED

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06137
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageLayout must not be VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL or VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06138
    If imageView is not VK_NULL_HANDLE, layout must not be VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06139
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageLayout must not be VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06140
    If imageView is not VK_NULL_HANDLE, layout must not be VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06141
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageLayout must not be VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06142
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageLayout must not be VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06143
    If imageView is not VK_NULL_HANDLE, layout must not be VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06144
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageLayout must not be VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06145
    If imageView is not VK_NULL_HANDLE, layout must not be VK_IMAGE_LAYOUT_PRESENT_SRC_KHR

  • VUID-VkRenderingAttachmentInfoKHR-imageView-06146
    If imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, resolveImageLayout must not be VK_IMAGE_LAYOUT_PRESENT_SRC_KHR

Valid Usage (Implicit)
  • VUID-VkRenderingAttachmentInfoKHR-sType-sType
    sType must be VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR

  • VUID-VkRenderingAttachmentInfoKHR-pNext-pNext
    pNext must be NULL

  • VUID-VkRenderingAttachmentInfoKHR-imageView-parameter
    If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle

  • VUID-VkRenderingAttachmentInfoKHR-imageLayout-parameter
    imageLayout must be a valid VkImageLayout value

  • VUID-VkRenderingAttachmentInfoKHR-resolveMode-parameter
    If resolveMode is not 0, resolveMode must be a valid VkResolveModeFlagBits value

  • VUID-VkRenderingAttachmentInfoKHR-resolveImageView-parameter
    If resolveImageView is not VK_NULL_HANDLE, resolveImageView must be a valid VkImageView handle

  • VUID-VkRenderingAttachmentInfoKHR-resolveImageLayout-parameter
    resolveImageLayout must be a valid VkImageLayout value

  • VUID-VkRenderingAttachmentInfoKHR-loadOp-parameter
    loadOp must be a valid VkAttachmentLoadOp value

  • VUID-VkRenderingAttachmentInfoKHR-storeOp-parameter
    storeOp must be a valid VkAttachmentStoreOp value

  • VUID-VkRenderingAttachmentInfoKHR-clearValue-parameter
    clearValue must be a valid VkClearValue union

  • VUID-VkRenderingAttachmentInfoKHR-commonparent
    Both of imageView, and resolveImageView that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice

See Also

Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2021 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0