C Specification

The VkSubpassDependency2KHR structure is defined as:

typedef struct VkSubpassDependency2KHR {
VkStructureType         sType;
const void*             pNext;
uint32_t                srcSubpass;
uint32_t                dstSubpass;
VkDependencyFlags       dependencyFlags;
int32_t                 viewOffset;
} VkSubpassDependency2KHR;

Members

• sType is the type of this structure.

• pNext is NULL or a pointer to an extension-specific 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.

Valid Usage
• If srcSubpass is not VK_SUBPASS_EXTERNAL, srcStageMask must not include VK_PIPELINE_STAGE_HOST_BIT

• If dstSubpass is not VK_SUBPASS_EXTERNAL, dstStageMask must not include VK_PIPELINE_STAGE_HOST_BIT

• If the geometry shaders feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT

• If the geometry shaders feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT

• If the tessellation shaders feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT

• If the tessellation shaders feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT

• 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

• srcSubpass and dstSubpass must not both be equal to VK_SUBPASS_EXTERNAL

• If srcSubpass is equal to dstSubpass, srcStageMask and dstStageMask must not set any bits that are neither VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, nor one of the graphics pipeline stages

• If srcSubpass is equal to dstSubpass and not all of the stages in srcStageMask and dstStageMask are framebuffer-space stages, the logically latest pipeline stage in srcStageMask must be logically earlier than or equal to the logically earliest pipeline stage in dstStageMask

• 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

• 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

• If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT, srcSubpass must not be equal to VK_SUBPASS_EXTERNAL

• If dependencyFlags includes VK_DEPENDENCY_VIEW_LOCAL_BIT, dstSubpass must not be equal to VK_SUBPASS_EXTERNAL

• If srcSubpass equals dstSubpass, and srcStageMask and dstStageMask both include a framebuffer-space stage, then dependencyFlags must include VK_DEPENDENCY_BY_REGION_BIT

• If viewOffset is not equal to 0, srcSubpass must not be equal to dstSubpass

• If dependencyFlags does not include VK_DEPENDENCY_VIEW_LOCAL_BIT, viewOffset must be 0

• If viewOffset is not 0, srcSubpass must not be equal to dstSubpass.

• If the mesh shaders feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV

• If the task shaders feature is not enabled, srcStageMask must not contain VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV

• If the mesh shaders feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV

• If the task shaders feature is not enabled, dstStageMask must not contain VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV

Valid Usage (Implicit)
• sType must be VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR

• srcStageMask must be a valid combination of VkPipelineStageFlagBits values

• srcStageMask must not be 0

• dstStageMask must be a valid combination of VkPipelineStageFlagBits values

• dstStageMask must not be 0

• srcAccessMask must be a valid combination of VkAccessFlagBits values

• dstAccessMask must be a valid combination of VkAccessFlagBits values

• dependencyFlags must be a valid combination of VkDependencyFlagBits values