If srcSubpass is equal to dstSubpass then the VkSubpassDependency does not directly define a dependency. Instead, it enables pipeline barriers to be used in a render pass instance within the identified subpass, where the scopes of one pipeline barrier must be a subset of those described by one subpass dependency. Subpass dependencies specified in this way that include framebuffer-space stages in the srcStageMask must only include framebuffer-space stages in dstStageMask, and must include DEPENDENCY_BY_REGION_BIT. When a subpass dependency is specified in this way for a subpass that has more than one view in its view mask, its dependencyFlags must include DEPENDENCY_VIEW_LOCAL_BIT.
If srcSubpass and dstSubpass are not equal, when a render pass instance which includes a subpass dependency is submitted to a queue, it defines a dependency between the subpasses identified by srcSubpass and dstSubpass.
If srcSubpass is equal to SUBPASS_EXTERNAL, the first synchronization scope includes commands that occur earlier in submission order than the CmdBeginRenderPass used to begin the render pass instance. Otherwise, the first set of commands includes all commands submitted as part of the subpass instance identified by srcSubpass and any load, store, or multisample resolve operations on attachments used in srcSubpass. In either case, the first synchronization scope is limited to operations on the pipeline stages determined by the source stage mask specified by srcStageMask.
If dstSubpass is equal to SUBPASS_EXTERNAL, the second synchronization scope includes commands that occur later in submission order than the CmdEndRenderPass used to end the render pass instance. Otherwise, the second set of commands includes all commands submitted as part of the subpass instance identified by dstSubpass and any load, store, and multisample resolve operations on attachments used in dstSubpass. In either case, the second synchronization scope is limited to operations on the pipeline stages determined by the destination stage mask specified by dstStageMask.
The first access scope is limited to accesses in the pipeline stages determined by the source stage mask specified by srcStageMask. It is also limited to access types in the source access mask specified by srcAccessMask.
The second access scope is limited to accesses in the pipeline stages determined by the destination stage mask specified by dstStageMask. It is also limited to access types in the destination access mask specified by dstAccessMask.
The availability and visibility operations defined by a subpass dependency affect the execution of image layout transitions within the render pass.
For non-attachment resources, the memory dependency expressed by subpass dependency is nearly identical to that of a VkMemoryBarrier (with matching srcAccessMask and dstAccessMask parameters) submitted as a part of a CmdPipelineBarrier (with matching srcStageMask and dstStageMask parameters). The only difference being that its scopes are limited to the identified subpasses rather than potentially affecting everything before and after.
For attachments however, subpass dependencies work more like a VkImageMemoryBarrier defined similarly to the VkMemoryBarrier above, the queue family indices set to QUEUE_FAMILY_IGNORED, and layouts as follows:
oldLayout is the attachment’s layout according to the subpass description for srcSubpass.newLayout is the attachment’s layout according to the subpass description for dstSubpass.geometryShader feature is not enabled, srcStageMask must not contain PIPELINE_STAGE_GEOMETRY_SHADER_BITtessellationShader feature is not enabled, srcStageMask must not contain PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BITconditionalRendering feature is not enabled, srcStageMask must not contain PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXTfragmentDensityMap feature is not enabled, srcStageMask must not contain PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXTtransformFeedback feature is not enabled, srcStageMask must not contain PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXTmeshShader feature is not enabled, srcStageMask must not contain PIPELINE_STAGE_MESH_SHADER_BIT_EXTtaskShader feature is not enabled, srcStageMask must not contain PIPELINE_STAGE_TASK_SHADER_BIT_EXTshadingRateImage or attachmentFragmentShadingRate are enabled, srcStageMask must not contain PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHRsynchronization2 feature is not enabled, srcStageMask must not be 0VK_NV_ray_tracing extension or rayTracingPipeline feature are enabled, srcStageMask must not contain PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHRgeometryShader feature is not enabled, dstStageMask must not contain PIPELINE_STAGE_GEOMETRY_SHADER_BITtessellationShader feature is not enabled, dstStageMask must not contain PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BITconditionalRendering feature is not enabled, dstStageMask must not contain PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXTfragmentDensityMap feature is not enabled, dstStageMask must not contain PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXTtransformFeedback feature is not enabled, dstStageMask must not contain PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXTmeshShader feature is not enabled, dstStageMask must not contain PIPELINE_STAGE_MESH_SHADER_BIT_EXTtaskShader feature is not enabled, dstStageMask must not contain PIPELINE_STAGE_TASK_SHADER_BIT_EXTshadingRateImage or attachmentFragmentShadingRate are enabled, dstStageMask must not contain PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHRsynchronization2 feature is not enabled, dstStageMask must not be 0VK_NV_ray_tracing extension or rayTracingPipeline feature are enabled, dstStageMask must not contain PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHRsrcSubpass must be less than or equal to dstSubpass, unless one of them is SUBPASS_EXTERNAL, to avoid cyclic dependencies and ensure a valid execution ordersrcSubpass and dstSubpass must not both be equal to SUBPASS_EXTERNALsrcSubpass is equal to dstSubpass and srcStageMask includes a framebuffer-space stage, dstStageMask must only contain framebuffer-space stagessrcAccessMask must be supported by one of the pipeline stages in srcStageMask, as specified in the table of supported access typesdstAccessMask must be supported by one of the pipeline stages in dstStageMask, as specified in the table of supported access typessrcSubpass equals dstSubpass, and srcStageMask and dstStageMask both include a framebuffer-space stage, then dependencyFlags must include DEPENDENCY_BY_REGION_BITdependencyFlags includes DEPENDENCY_VIEW_LOCAL_BIT, srcSubpass must not be equal to SUBPASS_EXTERNALdependencyFlags includes DEPENDENCY_VIEW_LOCAL_BIT, dstSubpass must not be equal to SUBPASS_EXTERNALsrcSubpass equals dstSubpass and that subpass has more than one bit set in the view mask, then dependencyFlags must include DEPENDENCY_VIEW_LOCAL_BITsrcStageMask must be a valid combination of VkPipelineStageFlagBits valuesdstStageMask must be a valid combination of VkPipelineStageFlagBits valuessrcAccessMask must be a valid combination of VkAccessFlagBits valuesdstAccessMask must be a valid combination of VkAccessFlagBits valuesdependencyFlags must be a valid combination of VkDependencyFlagBits values
struct VkSubpassDependency {
uint32_t srcSubpass;
uint32_t dstSubpass;
VkPipelineStageFlags srcStageMask;
VkPipelineStageFlags dstStageMask;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
VkDependencyFlags dependencyFlags;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | VkSubpassDependency.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | DEPENDENCYFLAGS
The struct member offsets. |
| public static final int | DSTACCESSMASK
The struct member offsets. |
| public static final int | DSTSTAGEMASK
The struct member offsets. |
| public static final int | DSTSUBPASS
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | SRCACCESSMASK
The struct member offsets. |
| public static final int | SRCSTAGEMASK
The struct member offsets. |
| public static final int | SRCSUBPASS
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkSubpassDependency(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static VkSubpassDependency | |
| public static VkSubpassDependency. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkSubpassDependency | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkSubpassDependency. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkSubpassDependency | |
| public static VkSubpassDependency | |
| public static VkSubpassDependency. | |
| public static VkSubpassDependency. | |
| protected VkSubpassDependency | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkSubpassDependency | |
| public static VkSubpassDependency | |
| public static VkSubpassDependency. | create(int
the buffer capacity capacity)Returns a new |
| public static VkSubpassDependency. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkSubpassDependency | |
| public static VkSubpassDependency. | |
| public int | |
| public VkSubpassDependency | |
| public int | |
| public VkSubpassDependency | |
| public int | |
| public VkSubpassDependency | |
| public int | |
| public VkSubpassDependency | |
| public static VkSubpassDependency | |
| public static VkSubpassDependency. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkSubpassDependency | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkSubpassDependency. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkSubpassDependency | |
| public static VkSubpassDependency | |
| public static VkSubpassDependency. | |
| public static VkSubpassDependency. | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public VkSubpassDependency | set(int srcSubpass, int dstSubpass, int srcStageMask, int dstStageMask, int srcAccessMask, int dstAccessMask, int dependencyFlags)
Initializes this struct with the specified values. |
| public VkSubpassDependency | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public int | |
| public VkSubpassDependency | |
| public int | |
| public VkSubpassDependency | |
| public int | |
| public VkSubpassDependency |