Class VkBufferMemoryBarrier2

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

public class VkBufferMemoryBarrier2 extends org.lwjgl.system.Struct<VkBufferMemoryBarrier2> implements org.lwjgl.system.NativeResource
Structure specifying a buffer memory barrier.
Description

This structure defines a memory dependency limited to a range of a buffer, and can define a queue family ownership transfer operation for that 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 buffer in the range defined by offset and size.

If buffer 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 buffer 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 buffer range, and 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.

Valid Usage
Valid Usage (Implicit)
  • sType must be STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2
  • pNext must be NULL or a pointer to a valid instance of VkExternalMemoryAcquireUnmodifiedEXT
  • 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
  • buffer must be a valid VkBuffer handle
See Also

VkDependencyInfo

Layout


 struct VkBufferMemoryBarrier2 {
     VkStructureType sType();
     void const * pNext();
     VkPipelineStageFlags2 srcStageMask();
     VkAccessFlags2 srcAccessMask();
     VkPipelineStageFlags2 dstStageMask();
     VkAccessFlags2 dstAccessMask();
     uint32_t srcQueueFamilyIndex();
     uint32_t dstQueueFamilyIndex();
     VkBuffer buffer();
     VkDeviceSize offset();
     VkDeviceSize size();
 }
  • 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.
    • SRCQUEUEFAMILYINDEX

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

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

      public static final int BUFFER
      The struct member offsets.
    • OFFSET

      public static final int OFFSET
      The struct member offsets.
    • SIZE

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

    • VkBufferMemoryBarrier2

      public VkBufferMemoryBarrier2(ByteBuffer container)
      Creates a VkBufferMemoryBarrier2 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<VkBufferMemoryBarrier2>
    • sType

      public int sType()
      a VkStructureType value identifying this structure.
    • pNext

      public long pNext()
      NULL or a pointer to a structure extending this structure.
    • srcStageMask

      public long srcStageMask()
      a VkPipelineStageFlags2 mask of pipeline stages to be included in the first synchronization scope.
    • srcAccessMask

      public long srcAccessMask()
      a VkAccessFlags2 mask of access flags to be included in the first access scope.
    • dstStageMask

      public long dstStageMask()
      a VkPipelineStageFlags2 mask of pipeline stages to be included in the second synchronization scope.
    • dstAccessMask

      public long dstAccessMask()
      a VkAccessFlags2 mask of access flags to be included in the second access scope.
    • srcQueueFamilyIndex

      public int srcQueueFamilyIndex()
      the source queue family for a queue family ownership transfer.
    • dstQueueFamilyIndex

      public int dstQueueFamilyIndex()
      the destination queue family for a queue family ownership transfer.
    • buffer

      public long buffer()
      a handle to the buffer whose backing memory is affected by the barrier.
    • offset

      public long offset()
      an offset in bytes into the backing memory for buffer; this is relative to the base offset as bound to the buffer (see BindBufferMemory).
    • size

      public long size()
      a size in bytes of the affected area of backing memory for buffer, or WHOLE_SIZE to use the range from offset to the end of the buffer.
    • sType

      public VkBufferMemoryBarrier2 sType(int value)
      Sets the specified value to the sType() field.
    • sType$Default

      public VkBufferMemoryBarrier2 sType$Default()
      Sets the STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2 value to the sType() field.
    • pNext

      public VkBufferMemoryBarrier2 pNext(long value)
      Sets the specified value to the pNext() field.
    • pNext

      Prepends the specified VkExternalMemoryAcquireUnmodifiedEXT value to the pNext chain.
    • srcStageMask

      public VkBufferMemoryBarrier2 srcStageMask(long value)
      Sets the specified value to the srcStageMask() field.
    • srcAccessMask

      public VkBufferMemoryBarrier2 srcAccessMask(long value)
      Sets the specified value to the srcAccessMask() field.
    • dstStageMask

      public VkBufferMemoryBarrier2 dstStageMask(long value)
      Sets the specified value to the dstStageMask() field.
    • dstAccessMask

      public VkBufferMemoryBarrier2 dstAccessMask(long value)
      Sets the specified value to the dstAccessMask() field.
    • srcQueueFamilyIndex

      public VkBufferMemoryBarrier2 srcQueueFamilyIndex(int value)
      Sets the specified value to the srcQueueFamilyIndex() field.
    • dstQueueFamilyIndex

      public VkBufferMemoryBarrier2 dstQueueFamilyIndex(int value)
      Sets the specified value to the dstQueueFamilyIndex() field.
    • buffer

      public VkBufferMemoryBarrier2 buffer(long value)
      Sets the specified value to the buffer() field.
    • offset

      public VkBufferMemoryBarrier2 offset(long value)
      Sets the specified value to the offset() field.
    • size

      public VkBufferMemoryBarrier2 size(long value)
      Sets the specified value to the size() field.
    • set

      public VkBufferMemoryBarrier2 set(int sType, long pNext, long srcStageMask, long srcAccessMask, long dstStageMask, long dstAccessMask, int srcQueueFamilyIndex, int dstQueueFamilyIndex, long buffer, long offset, long size)
      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 VkBufferMemoryBarrier2 malloc()
      Returns a new VkBufferMemoryBarrier2 instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

      public static VkBufferMemoryBarrier2.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkBufferMemoryBarrier2.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
    • nsType

      public static int nsType(long struct)
      Unsafe version of sType().
    • npNext

      public static long npNext(long struct)
      Unsafe version of pNext().
    • nsrcStageMask

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

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

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

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

      public static int nsrcQueueFamilyIndex(long struct)
      Unsafe version of srcQueueFamilyIndex().
    • ndstQueueFamilyIndex

      public static int ndstQueueFamilyIndex(long struct)
      Unsafe version of dstQueueFamilyIndex().
    • nbuffer

      public static long nbuffer(long struct)
      Unsafe version of buffer().
    • noffset

      public static long noffset(long struct)
      Unsafe version of offset().
    • nsize

      public static long nsize(long struct)
      Unsafe version of size().
    • nsType

      public static void nsType(long struct, int value)
      Unsafe version of sType.
    • npNext

      public static void npNext(long struct, long value)
      Unsafe version of pNext.
    • nsrcStageMask

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

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

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

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

      public static void nsrcQueueFamilyIndex(long struct, int value)
      Unsafe version of srcQueueFamilyIndex.
    • ndstQueueFamilyIndex

      public static void ndstQueueFamilyIndex(long struct, int value)
      Unsafe version of dstQueueFamilyIndex.
    • nbuffer

      public static void nbuffer(long struct, long value)
      Unsafe version of buffer.
    • noffset

      public static void noffset(long struct, long value)
      Unsafe version of offset.
    • nsize

      public static void nsize(long struct, long value)
      Unsafe version of size.