VKSUBPASSDEPENDENCY(3)

NAME
VkSubpassDependency - Structure specifying a subpass dependency

C SPECIFICATION

The VkSubpassDependency structure is defined as:

    typedef struct VkSubpassDependency {
        uint32_t                srcSubpass;
        uint32_t                dstSubpass;
        VkPipelineStageFlags    srcStageMask;
        VkPipelineStageFlags    dstStageMask;
        VkAccessFlags           srcAccessMask;
        VkAccessFlags           dstAccessMask;
        VkDependencyFlags       dependencyFlags;
    } VkSubpassDependency;

MEMBERS

    • srcSubpass and dstSubpass are the subpass indices of the producer and consumer subpasses, respectively. srcSubpass and dstSubpass can also have the special value VK_SUBPASS_EXTERNAL. The source subpass must always be a lower numbered subpass than the destination subpass (excluding external subpasses and self-dependencies), so that the order of subpass descriptions is a valid execution ordering, avoiding cycles in the dependency graph.

    • srcStageMask, dstStageMask, srcAccessMask, dstAccessMask, and dependencyFlags describe an execution and memory dependency between subpasses. The bits that can be included in dependencyFlags are:

        typedef enum VkDependencyFlagBits {
            VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
        } VkDependencyFlagBits;

        • If dependencyFlags contains VK_DEPENDENCY_BY_REGION_BIT, then the dependency is by-region as defined in Execution And Memory Dependencies.

DESCRIPTION

Each subpass dependency defines an execution and memory dependency between two sets of commands, with the second set depending on the first set. When srcSubpass does not equal dstSubpass then the first set of commands is:

    • All commands in the subpass indicated by srcSubpass, if srcSubpass is not VK_SUBPASS_EXTERNAL.

    • All commands before the render pass instance, if srcSubpass is VK_SUBPASS_EXTERNAL.

While the corresponding second set of commands is:

    • All commands in the subpass indicated by dstSubpass, if dstSubpass is not VK_SUBPASS_EXTERNAL.

    • All commands after the render pass instance, if dstSubpass is VK_SUBPASS_EXTERNAL.

When srcSubpass equals dstSubpass then the first set consists of commands in the subpass before a call to vkCmdPipelineBarrier and the second set consists of commands in the subpass following that same call as described in the Subpass Self-dependency section.

The srcStageMask, dstStageMask, srcAccessMask, dstAccessMask, and dependencyFlags parameters of the dependency are interpreted the same way as for other dependencies, as described in Synchronization and Cache Control.

VALID USAGE

    • 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

    • 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 only contain one of VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT, VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT, VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, or VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT

    • If srcSubpass is equal to dstSubpass, the highest bit value included in srcStageMask must be less than or equal to the lowest bit value in dstStageMask

SEE ALSO

VkAccessFlags, VkDependencyFlags, VkPipelineStageFlags, VkRenderPassCreateInfo

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkSubpassDependency

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.