VkSubpassDependency2(3)

# VkSubpassDependency2(3) Manual Page

## Name

VkSubpassDependency2 - Structure specifying a subpass dependency

Loading… please wait.

## C Specification

The `VkSubpassDependency2` structure is defined as:

    // Provided by VK_VERSION_1_2
    typedef struct VkSubpassDependency2 {
        VkStructureType         sType;
        const void*             pNext;
        uint32_t                srcSubpass;
        uint32_t                dstSubpass;
        VkPipelineStageFlags    srcStageMask;
        VkPipelineStageFlags    dstStageMask;
        VkAccessFlags           srcAccessMask;
        VkAccessFlags           dstAccessMask;
        VkDependencyFlags       dependencyFlags;
        int32_t                 viewOffset;
    } VkSubpassDependency2;

or the equivalent

    // Provided by VK_KHR_create_renderpass2
    typedef VkSubpassDependency2 VkSubpassDependency2KHR;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to a structure extending this structure.

- `srcSubpass` is the subpass index of the first subpass in the dependency, or `VK_SUBPASS_EXTERNAL`.

- `dstSubpass` is the subpass index of the second subpass in the dependency, or `VK_SUBPASS_EXTERNAL`.

- `srcStageMask` is a bitmask of VkPipelineStageFlagBits specifying the source stage mask.

- `dstStageMask` is a bitmask of VkPipelineStageFlagBits specifying the destination stage mask

- `srcAccessMask` is a bitmask of VkAccessFlagBits specifying a source access mask.

- `dstAccessMask` is a bitmask of VkAccessFlagBits specifying a destination access mask.

- `dependencyFlags` is a bitmask of VkDependencyFlagBits.

- `viewOffset` controls which views in the source subpass the views in the destination subpass depend on.

## Description

Parameters defined by this structure with the same name as those in VkSubpassDependency have the identical effect to those parameters.

`viewOffset` has the same effect for the described subpass dependency as VkRenderPassMultiviewCreateInfo::`pViewOffsets` has on each corresponding subpass dependency.

If a VkMemoryBarrier2 is included in the `pNext` chain, `srcStageMask`, `dstStageMask`, `srcAccessMask`, and `dstAccessMask` parameters are ignored. The synchronization and access scopes instead are defined by the parameters of VkMemoryBarrier2.

Valid Usage

- VUID-VkSubpassDependency2-srcStageMask-04090
  If the `geometryShader` feature is not enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT`

- VUID-VkSubpassDependency2-srcStageMask-04091
  If the `tessellationShader` feature is not enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT` or `VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT`

- VUID-VkSubpassDependency2-srcStageMask-04092
  If the `conditionalRendering` feature is not enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT`

- VUID-VkSubpassDependency2-srcStageMask-04093
  If the `fragmentDensityMap` feature is not enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT`

- VUID-VkSubpassDependency2-srcStageMask-04094
  If the `transformFeedback` feature is not enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT`

- VUID-VkSubpassDependency2-srcStageMask-04095
  If the `meshShader` feature is not enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT`

- VUID-VkSubpassDependency2-srcStageMask-04096
  If the `taskShader` feature is not enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT`

- VUID-VkSubpassDependency2-shadingRateImage-07318
  If neither the `shadingRateImage` or `attachmentFragmentShadingRate` are enabled, `srcStageMask` must not contain `VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

- VUID-VkSubpassDependency2-srcStageMask-03937
  If the `synchronization2` feature is not enabled, `srcStageMask` must not be `0`

- VUID-VkSubpassDependency2-dstStageMask-04090
  If the `geometryShader` feature is not enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT`

- VUID-VkSubpassDependency2-dstStageMask-04091
  If the `tessellationShader` feature is not enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT` or `VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT`

- VUID-VkSubpassDependency2-dstStageMask-04092
  If the `conditionalRendering` feature is not enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT`

- VUID-VkSubpassDependency2-dstStageMask-04093
  If the `fragmentDensityMap` feature is not enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT`

- VUID-VkSubpassDependency2-dstStageMask-04094
  If the `transformFeedback` feature is not enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT`

- VUID-VkSubpassDependency2-dstStageMask-04095
  If the `meshShader` feature is not enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT`

- VUID-VkSubpassDependency2-dstStageMask-04096
  If the `taskShader` feature is not enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT`

- VUID-VkSubpassDependency2-shadingRateImage-07318
  If neither the `shadingRateImage` or `attachmentFragmentShadingRate` are enabled, `dstStageMask` must not contain `VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR`

- VUID-VkSubpassDependency2-dstStageMask-03937
  If the `synchronization2` feature is not enabled, `dstStageMask` must not be `0`

- VUID-VkSubpassDependency2-srcSubpass-03084
  `srcSubpass` must be less than or equal to `dstSubpass`, unless one of them is `VK_SUBPASS_EXTERNAL`, to avoid cyclic dependencies and ensure a valid execution order

- VUID-VkSubpassDependency2-srcSubpass-03085
  `srcSubpass` and `dstSubpass` must not both be equal to `VK_SUBPASS_EXTERNAL`

- VUID-VkSubpassDependency2-srcSubpass-06810
  If `srcSubpass` is equal to `dstSubpass` and `srcStageMask` includes a framebuffer-space stage, `dstStageMask` must only contain framebuffer-space stages

- VUID-VkSubpassDependency2-srcAccessMask-03088
  Any access flag included in `srcAccessMask` must be supported by one of the pipeline stages in `srcStageMask`, as specified in the table of supported access types

- VUID-VkSubpassDependency2-dstAccessMask-03089
  Any access flag included in `dstAccessMask` must be supported by one of the pipeline stages in `dstStageMask`, as specified in the table of supported access types

- VUID-VkSubpassDependency2-dependencyFlags-03090
  If `dependencyFlags` includes `VK_DEPENDENCY_VIEW_LOCAL_BIT`, `srcSubpass` must not be equal to `VK_SUBPASS_EXTERNAL`

- VUID-VkSubpassDependency2-dependencyFlags-03091
  If `dependencyFlags` includes `VK_DEPENDENCY_VIEW_LOCAL_BIT`, `dstSubpass` must not be equal to `VK_SUBPASS_EXTERNAL`

- VUID-VkSubpassDependency2-srcSubpass-02245
  If `srcSubpass` equals `dstSubpass`, and `srcStageMask` and `dstStageMask` both include a framebuffer-space stage, then `dependencyFlags` must include `VK_DEPENDENCY_BY_REGION_BIT`

- VUID-VkSubpassDependency2-viewOffset-02530
  If `viewOffset` is not equal to `0`, `srcSubpass` must not be equal to `dstSubpass`

- VUID-VkSubpassDependency2-dependencyFlags-03092
  If `dependencyFlags` does not include `VK_DEPENDENCY_VIEW_LOCAL_BIT`, `viewOffset` must be `0`

Valid Usage (Implicit)

- VUID-VkSubpassDependency2-sType-sType
  `sType` must be `VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2`

- VUID-VkSubpassDependency2-pNext-pNext
  `pNext` must be `NULL` or a pointer to a valid instance of VkMemoryBarrier2

- VUID-VkSubpassDependency2-sType-unique
  The `sType` value of each struct in the `pNext` chain must be unique

- VUID-VkSubpassDependency2-srcStageMask-parameter
  `srcStageMask` must be a valid combination of VkPipelineStageFlagBits values

- VUID-VkSubpassDependency2-dstStageMask-parameter
  `dstStageMask` must be a valid combination of VkPipelineStageFlagBits values

- VUID-VkSubpassDependency2-srcAccessMask-parameter
  `srcAccessMask` must be a valid combination of VkAccessFlagBits values

- VUID-VkSubpassDependency2-dstAccessMask-parameter
  `dstAccessMask` must be a valid combination of VkAccessFlagBits values

- VUID-VkSubpassDependency2-dependencyFlags-parameter
  `dependencyFlags` must be a valid combination of VkDependencyFlagBits values

## See Also

VK_KHR_create_renderpass2, VK_VERSION_1_2, VkAccessFlags, VkDependencyFlags, VkPipelineStageFlags, VkRenderPassCreateInfo2, VkStructureType

## 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-2022 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0