VkAttachmentReference(3)

# VkAttachmentReference(3) Manual Page

## Name

VkAttachmentReference - Structure specifying an attachment reference

Loading… please wait.

## C Specification

The `VkAttachmentReference` structure is defined as:

Warning | This functionality is superseded by VkAttachmentReference2. See Legacy Functionality for more information.

    // Provided by VK_VERSION_1_0
    typedef struct VkAttachmentReference {
        uint32_t         attachment;
        VkImageLayout    layout;
    } VkAttachmentReference;

## Members

- `attachment` is either an integer value identifying an attachment at the corresponding index in VkRenderPassCreateInfo::`pAttachments`, or VK_ATTACHMENT_UNUSED to signify that this attachment is not used.

- `layout` is a VkImageLayout value specifying the layout the attachment uses during the subpass.

## Description

Valid Usage

- VUID-VkAttachmentReference-layout-03077
  If `attachment` is not VK_ATTACHMENT_UNUSED, `layout` must not be VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_ZERO_INITIALIZED_EXT, VK_IMAGE_LAYOUT_PREINITIALIZED, or VK_IMAGE_LAYOUT_PRESENT_SRC_KHR

- VUID-VkAttachmentReference-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-VkAttachmentReference-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-VkAttachmentReference-attachmentFeedbackLoopLayout-07311
  If the `attachmentFeedbackLoopLayout` feature is not enabled, `layout` must not be VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT

- VUID-VkAttachmentReference-dynamicRenderingLocalRead-09546
  If the `dynamicRenderingLocalRead` feature is not enabled, `layout` must not be VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ

Valid Usage (Implicit)

- VUID-VkAttachmentReference-layout-parameter
  `layout` must be a valid VkImageLayout value

## See Also

VK_VERSION_1_0, VkImageLayout, VkRenderPassFragmentDensityMapCreateInfoEXT, VkSubpassDescription

## 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

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0