Class VkSubpassDependency

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkSubpassDependency>
org.lwjgl.vulkan.VkSubpassDependency
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VkSubpassDependency extends org.lwjgl.system.Struct<VkSubpassDependency> implements org.lwjgl.system.NativeResource
Structure specifying a subpass dependency.
Description

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.

Note

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:

  • The equivalent to oldLayout is the attachment’s layout according to the subpass description for srcSubpass.
  • The equivalent to newLayout is the attachment’s layout according to the subpass description for dstSubpass.
Valid Usage
Valid Usage (Implicit)
  • srcStageMask must be a valid combination of VkPipelineStageFlagBits values
  • dstStageMask must be a valid combination of VkPipelineStageFlagBits values
  • 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
See Also

VkRenderPassCreateInfo

Layout


 struct VkSubpassDependency {
     uint32_t srcSubpass();
     uint32_t dstSubpass();
     VkPipelineStageFlags srcStageMask();
     VkPipelineStageFlags dstStageMask();
     VkAccessFlags srcAccessMask();
     VkAccessFlags dstAccessMask();
     VkDependencyFlags dependencyFlags();
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • SRCSUBPASS

      public static final int SRCSUBPASS
      The struct member offsets.
    • DSTSUBPASS

      public static final int DSTSUBPASS
      The struct member offsets.
    • SRCSTAGEMASK

      public static final int SRCSTAGEMASK
      The struct member offsets.
    • DSTSTAGEMASK

      public static final int DSTSTAGEMASK
      The struct member offsets.
    • SRCACCESSMASK

      public static final int SRCACCESSMASK
      The struct member offsets.
    • DSTACCESSMASK

      public static final int DSTACCESSMASK
      The struct member offsets.
    • DEPENDENCYFLAGS

      public static final int DEPENDENCYFLAGS
      The struct member offsets.
  • Constructor Details

    • VkSubpassDependency

      public VkSubpassDependency(ByteBuffer container)
      Creates a VkSubpassDependency instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VkSubpassDependency>
    • srcSubpass

      public int srcSubpass()
      the subpass index of the first subpass in the dependency, or SUBPASS_EXTERNAL.
    • dstSubpass

      public int dstSubpass()
      the subpass index of the second subpass in the dependency, or SUBPASS_EXTERNAL.
    • srcStageMask

      public int srcStageMask()
      a bitmask of VkPipelineStageFlagBits specifying the source stage mask.
    • dstStageMask

      public int dstStageMask()
      a bitmask of VkPipelineStageFlagBits specifying the destination stage mask
    • srcAccessMask

      public int srcAccessMask()
      a bitmask of VkAccessFlagBits specifying a source access mask.
    • dstAccessMask

      public int dstAccessMask()
      a bitmask of VkAccessFlagBits specifying a destination access mask.
    • dependencyFlags

      public int dependencyFlags()
      a bitmask of VkDependencyFlagBits.
    • srcSubpass

      public VkSubpassDependency srcSubpass(int value)
      Sets the specified value to the srcSubpass() field.
    • dstSubpass

      public VkSubpassDependency dstSubpass(int value)
      Sets the specified value to the dstSubpass() field.
    • srcStageMask

      public VkSubpassDependency srcStageMask(int value)
      Sets the specified value to the srcStageMask() field.
    • dstStageMask

      public VkSubpassDependency dstStageMask(int value)
      Sets the specified value to the dstStageMask() field.
    • srcAccessMask

      public VkSubpassDependency srcAccessMask(int value)
      Sets the specified value to the srcAccessMask() field.
    • dstAccessMask

      public VkSubpassDependency dstAccessMask(int value)
      Sets the specified value to the dstAccessMask() field.
    • dependencyFlags

      public VkSubpassDependency dependencyFlags(int value)
      Sets the specified value to the dependencyFlags() field.
    • set

      public VkSubpassDependency set(int srcSubpass, int dstSubpass, int srcStageMask, int dstStageMask, int srcAccessMask, int dstAccessMask, int dependencyFlags)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static VkSubpassDependency malloc()
      Returns a new VkSubpassDependency instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static VkSubpassDependency calloc()
      Returns a new VkSubpassDependency instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static VkSubpassDependency create()
      Returns a new VkSubpassDependency instance allocated with BufferUtils.
    • create

      public static VkSubpassDependency create(long address)
      Returns a new VkSubpassDependency instance for the specified memory address.
    • createSafe

      public static @Nullable VkSubpassDependency createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkSubpassDependency.Buffer malloc(int capacity)
      Returns a new VkSubpassDependency.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VkSubpassDependency.Buffer calloc(int capacity)
      Returns a new VkSubpassDependency.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkSubpassDependency.Buffer create(int capacity)
      Returns a new VkSubpassDependency.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkSubpassDependency.Buffer create(long address, int capacity)
      Create a VkSubpassDependency.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable VkSubpassDependency.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static VkSubpassDependency mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSubpassDependency callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSubpassDependency mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSubpassDependency callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSubpassDependency.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSubpassDependency.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSubpassDependency.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSubpassDependency.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static VkSubpassDependency malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkSubpassDependency instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static VkSubpassDependency calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkSubpassDependency instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static VkSubpassDependency.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkSubpassDependency.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VkSubpassDependency.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkSubpassDependency.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nsrcSubpass

      public static int nsrcSubpass(long struct)
      Unsafe version of srcSubpass().
    • ndstSubpass

      public static int ndstSubpass(long struct)
      Unsafe version of dstSubpass().
    • nsrcStageMask

      public static int nsrcStageMask(long struct)
      Unsafe version of srcStageMask().
    • ndstStageMask

      public static int ndstStageMask(long struct)
      Unsafe version of dstStageMask().
    • nsrcAccessMask

      public static int nsrcAccessMask(long struct)
      Unsafe version of srcAccessMask().
    • ndstAccessMask

      public static int ndstAccessMask(long struct)
      Unsafe version of dstAccessMask().
    • ndependencyFlags

      public static int ndependencyFlags(long struct)
      Unsafe version of dependencyFlags().
    • nsrcSubpass

      public static void nsrcSubpass(long struct, int value)
      Unsafe version of srcSubpass.
    • ndstSubpass

      public static void ndstSubpass(long struct, int value)
      Unsafe version of dstSubpass.
    • nsrcStageMask

      public static void nsrcStageMask(long struct, int value)
      Unsafe version of srcStageMask.
    • ndstStageMask

      public static void ndstStageMask(long struct, int value)
      Unsafe version of dstStageMask.
    • nsrcAccessMask

      public static void nsrcAccessMask(long struct, int value)
      Unsafe version of srcAccessMask.
    • ndstAccessMask

      public static void ndstAccessMask(long struct, int value)
      Unsafe version of dstAccessMask.
    • ndependencyFlags

      public static void ndependencyFlags(long struct, int value)
      Unsafe version of dependencyFlags.