Class VkImageMemoryBarrier2

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkImageMemoryBarrier2>
org.lwjgl.vulkan.VkImageMemoryBarrier2
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
Direct Known Subclasses:
VkImageMemoryBarrier2KHR

public class VkImageMemoryBarrier2 extends org.lwjgl.system.Struct<VkImageMemoryBarrier2> implements org.lwjgl.system.NativeResource
Structure specifying an image memory barrier.
Description

This structure defines a memory dependency limited to an image subresource range, and can define a queue family ownership transfer operation and image layout transition for that subresource range.

The first synchronization scope and access scope described by this structure include only operations and memory accesses specified by srcStageMask and srcAccessMask.

The second synchronization scope and access scope described by this structure include only operations and memory accesses specified by dstStageMask and dstAccessMask.

Both access scopes are limited to only memory accesses to image in the subresource range defined by subresourceRange.

If image was created with SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex is not equal to dstQueueFamilyIndex, this memory barrier defines a queue family ownership transfer operation. When executed on a queue in the family identified by srcQueueFamilyIndex, this barrier defines a queue family release operation for the specified image subresource range, and the second synchronization scope does not apply to this operation. When executed on a queue in the family identified by dstQueueFamilyIndex, this barrier defines a queue family acquire operation for the specified image subresource range, and the first synchronization, the first synchronization scope does not apply to this operation.

A queue family ownership transfer operation is also defined if the values are not equal, and either is one of the special queue family values reserved for external memory ownership transfers, as described in Queue Family Ownership Transfer. A queue family release operation is defined when dstQueueFamilyIndex is one of those values, and a queue family acquire operation is defined when srcQueueFamilyIndex is one of those values.

If oldLayout is not equal to newLayout, then the memory barrier defines an image layout transition for the specified image subresource range. If this memory barrier defines a queue family ownership transfer operation, the layout transition is only executed once between the queues.

Note

When the old and new layout are equal, the layout values are ignored - data is preserved no matter what values are specified, or what layout the image is currently in.

If image has a multi-planar format and the image is disjoint, then including IMAGE_ASPECT_COLOR_BIT in the aspectMask member of subresourceRange is equivalent to including IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, and (for three-plane formats only) IMAGE_ASPECT_PLANE_2_BIT.

Valid Usage
Valid Usage (Implicit)
  • sType must be STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2
  • Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExternalMemoryAcquireUnmodifiedEXT or VkSampleLocationsInfoEXT
  • The sType value of each struct in the pNext chain must be unique
  • srcStageMask must be a valid combination of VkPipelineStageFlagBits2 values
  • srcAccessMask must be a valid combination of VkAccessFlagBits2 values
  • dstStageMask must be a valid combination of VkPipelineStageFlagBits2 values
  • dstAccessMask must be a valid combination of VkAccessFlagBits2 values
  • oldLayout must be a valid VkImageLayout value
  • newLayout must be a valid VkImageLayout value
  • image must be a valid VkImage handle
  • subresourceRange must be a valid VkImageSubresourceRange structure
See Also

VkDependencyInfo, VkImageSubresourceRange

Layout


 struct VkImageMemoryBarrier2 {
     VkStructureType sType();
     void const * pNext();
     VkPipelineStageFlags2 srcStageMask();
     VkAccessFlags2 srcAccessMask();
     VkPipelineStageFlags2 dstStageMask();
     VkAccessFlags2 dstAccessMask();
     VkImageLayout oldLayout();
     VkImageLayout newLayout();
     uint32_t srcQueueFamilyIndex();
     uint32_t dstQueueFamilyIndex();
     VkImage image();
     VkImageSubresourceRange subresourceRange();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int STYPE
      The struct member offsets.
    • PNEXT

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

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

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

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

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

      public static final int OLDLAYOUT
      The struct member offsets.
    • NEWLAYOUT

      public static final int NEWLAYOUT
      The struct member offsets.
    • SRCQUEUEFAMILYINDEX

      public static final int SRCQUEUEFAMILYINDEX
      The struct member offsets.
    • DSTQUEUEFAMILYINDEX

      public static final int DSTQUEUEFAMILYINDEX
      The struct member offsets.
    • IMAGE

      public static final int IMAGE
      The struct member offsets.
    • SUBRESOURCERANGE

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

    • VkImageMemoryBarrier2

      public VkImageMemoryBarrier2(ByteBuffer container)
      Creates a VkImageMemoryBarrier2 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