VkRenderPassCreateInfo(3)

# VkRenderPassCreateInfo(3) Manual Page

## Name

VkRenderPassCreateInfo - Structure specifying parameters of a newly created render pass

## C Specification

The `VkRenderPassCreateInfo` structure is defined as:

    typedef struct VkRenderPassCreateInfo {
        VkStructureType                   sType;
        const void*                       pNext;
        VkRenderPassCreateFlags           flags;
        uint32_t                          attachmentCount;
        const VkAttachmentDescription*    pAttachments;
        uint32_t                          subpassCount;
        const VkSubpassDescription*       pSubpasses;
        uint32_t                          dependencyCount;
        const VkSubpassDependency*        pDependencies;
    } VkRenderPassCreateInfo;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to an extension-specific structure.

- `flags` is reserved for future use.

- `attachmentCount` is the number of attachments used by this render pass.

- `pAttachments` is a pointer to an array of `attachmentCount` VkAttachmentDescription structures describing the attachments used by the render pass.

- `subpassCount` is the number of subpasses to create.

- `pSubpasses` is a pointer to an array of `subpassCount` VkSubpassDescription structures describing each subpass.

- `dependencyCount` is the number of memory dependencies between pairs of subpasses.

- `pDependencies` is a pointer to an array of `dependencyCount` VkSubpassDependency structures describing dependencies between pairs of subpasses.

## Description

| Note Care should be taken to avoid a data race here; if any subpasses access attachments with overlapping memory locations, and one of those accesses is a write, a subpass dependency needs to be included between them.

Valid Usage

- If the `attachment` member of any element of `pInputAttachments`, `pColorAttachments`, `pResolveAttachments` or `pDepthStencilAttachment`, or any element of `pPreserveAttachments` in any element of `pSubpasses` is not `VK_ATTACHMENT_UNUSED`, it must be less than `attachmentCount`

- For any member of `pAttachments` with a `loadOp` equal to `VK_ATTACHMENT_LOAD_OP_CLEAR`, the first use of that attachment must not specify a `layout` equal to `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL` or `VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL`.

- For any member of `pAttachments` with a `stencilLoadOp` equal to `VK_ATTACHMENT_LOAD_OP_CLEAR`, the first use of that attachment must not specify a `layout` equal to `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL` or `VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL`.

- For any member of `pAttachments` with a `loadOp` equal to `VK_ATTACHMENT_LOAD_OP_CLEAR`, the first use of that attachment must not specify a `layout` equal to `VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL`.

- For any member of `pAttachments` with a `stencilLoadOp` equal to `VK_ATTACHMENT_LOAD_OP_CLEAR`, the first use of that attachment must not specify a `layout` equal to `VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL`.

- If the `pNext` chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, the `subpass` member of each element of its `pAspectReferences` member must be less than `subpassCount`

- If the `pNext` chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, the `inputAttachmentIndex` member of each element of its `pAspectReferences` member must be less than the value of `inputAttachmentCount` in the member of `pSubpasses` identified by its `subpass` member

- If the `pNext` chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, for any element of the `pInputAttachments` member of any element of `pSubpasses` where the `attachment` member is not `VK_ATTACHMENT_UNUSED`, the `aspectMask` member of the corresponding element of VkRenderPassInputAttachmentAspectCreateInfo::`pAspectReferences` must only include aspects that are present in images of the format specified by the element of `pAttachments` at `attachment`

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, and its `subpassCount` member is not zero, that member must be equal to the value of `subpassCount`

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, if its `dependencyCount` member is not zero, it must be equal to `dependencyCount`

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, for each non-zero element of `pViewOffsets`, the `srcSubpass` and `dstSubpass` members of `pDependencies` at the same index must not be equal

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, for any element of `pDependencies` with a `dependencyFlags` member that does not include `VK_DEPENDENCY_VIEW_LOCAL_BIT`, the corresponding element of the `pViewOffsets` member of that VkRenderPassMultiviewCreateInfo instance must be `0`

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, elements of its `pViewMasks` member must either all be `0`, or all not be `0`

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, and each element of its `pViewMasks` member is `0`, the `dependencyFlags` member of each element of `pDependencies` must not include `VK_DEPENDENCY_VIEW_LOCAL_BIT`

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, and each element of its `pViewMasks` member is `0`, `correlatedViewMaskCount` must be `0`

- If the `pNext` chain includes an instance of VkRenderPassMultiviewCreateInfo, each element of its `pViewMask` member must not have a bit set at an index greater than or equal to VkPhysicalDeviceLimits::`maxFramebufferLayers`

- For any element of `pDependencies`, if the `srcSubpass` is not `VK_SUBPASS_EXTERNAL`, all stage flags included in the `srcStageMask` member of that dependency must be a pipeline stage supported by the pipeline identified by the `pipelineBindPoint` member of the source subpass

- For any element of `pDependencies`, if the `dstSubpass` is not `VK_SUBPASS_EXTERNAL`, all stage flags included in the `dstStageMask` member of that dependency must be a pipeline stage supported by the pipeline identified by the `pipelineBindPoint` member of the destination subpass

- The `srcSubpass` member of each element of `pDependencies` must be less than `subpassCount`

- The `dstSubpass` member of each element of `pDependencies` must be less than `subpassCount`

Valid Usage (Implicit)

- `sType` must be `VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO`

- Each `pNext` member of any structure (including this one) in the `pNext` chain must be either `NULL` or a pointer to a valid instance of VkRenderPassFragmentDensityMapCreateInfoEXT, VkRenderPassInputAttachmentAspectCreateInfo, or VkRenderPassMultiviewCreateInfo

- Each `sType` member in the `pNext` chain must be unique

- `flags` must be `0`

- If `attachmentCount` is not `0`, `pAttachments` must be a valid pointer to an array of `attachmentCount` valid `VkAttachmentDescription` structures

- `pSubpasses` must be a valid pointer to an array of `subpassCount` valid `VkSubpassDescription` structures

- If `dependencyCount` is not `0`, `pDependencies` must be a valid pointer to an array of `dependencyCount` valid `VkSubpassDependency` structures

- `subpassCount` must be greater than `0`

## See Also

VkAttachmentDescription, VkRenderPassCreateFlags, VkStructureType, VkSubpassDependency, VkSubpassDescription, vkCreateRenderPass

## 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 (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.