Class VkBufferMemoryBarrier

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

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

    The first access scope is limited to access to memory through the specified buffer range, via access types in the source access mask specified by srcAccessMask. If srcAccessMask includes ACCESS_HOST_WRITE_BIT, memory writes performed by that access type are also made visible, as that access type is not performed through a resource.

    The second access scope is limited to access to memory through the specified buffer range, via access types in the destination access mask specified by dstAccessMask. If dstAccessMask includes ACCESS_HOST_WRITE_BIT or ACCESS_HOST_READ_BIT, available memory writes are also made visible to accesses of those types, as those access types are not performed through a resource.

    If srcQueueFamilyIndex is not equal to dstQueueFamilyIndex, and srcQueueFamilyIndex is equal to the current queue family, then the memory barrier defines a queue family release operation for the specified buffer range, and the second access scope includes no access, as if dstAccessMask was 0.

    If dstQueueFamilyIndex is not equal to srcQueueFamilyIndex, and dstQueueFamilyIndex is equal to the current queue family, then the memory barrier defines a queue family acquire operation for the specified buffer range, and the first access scope includes no access, as if srcAccessMask was 0.

    Valid Usage
    • offset must be less than the size of buffer
    • If size is not equal to WHOLE_SIZE, size must be greater than 0
    • If size is not equal to WHOLE_SIZE, size must be less than or equal to than the size of buffer minus offset
    • If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object
    • If srcQueueFamilyIndex is not equal to dstQueueFamilyIndex, at least one must not be a special queue family reserved for external memory ownership transfers, as described in Queue Family Ownership Transfer
    • If buffer was created with a sharing mode of SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex are not equal, and one of srcQueueFamilyIndex and dstQueueFamilyIndex is one of the special queue family values reserved for external memory transfers, the other must be QUEUE_FAMILY_IGNORED
    • If buffer was created with a sharing mode of SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not equal, srcQueueFamilyIndex and dstQueueFamilyIndex must both be valid queue families, or one of the special queue family values reserved for external memory transfers, as described in Queue Family Ownership Transfer
    • If the synchronization2 feature is not enabled, and buffer was created with a sharing mode of SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be QUEUE_FAMILY_IGNORED
    Valid Usage (Implicit)
    See Also

    CmdPipelineBarrier, CmdWaitEvents

    Layout

    
     struct VkBufferMemoryBarrier {
         VkStructureType sType();
         void const * pNext();
         VkAccessFlags srcAccessMask();
         VkAccessFlags dstAccessMask();
         uint32_t srcQueueFamilyIndex();
         uint32_t dstQueueFamilyIndex();
         VkBuffer buffer();
         VkDeviceSize offset();
         VkDeviceSize size();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, SRCACCESSMASK, DSTACCESSMASK, SRCQUEUEFAMILYINDEX, DSTQUEUEFAMILYINDEX, BUFFER, OFFSET, SIZE

        The struct member offsets.
    • Constructor Detail

      • VkBufferMemoryBarrier

        public VkBufferMemoryBarrier​(java.nio.ByteBuffer container)
        Creates a VkBufferMemoryBarrier 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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • sType

        public int sType()
        the type of this structure.
      • pNext

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

        public int srcAccessMask()
        a bitmask of VkAccessFlagBits specifying a source access mask.
      • 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.
      • set

        public VkBufferMemoryBarrier set​(int sType,
                                         long pNext,
                                         int srcAccessMask,
                                         int dstAccessMask,
                                         int srcQueueFamilyIndex,
                                         int dstQueueFamilyIndex,
                                         long buffer,
                                         long offset,
                                         long size)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

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

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

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

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

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

        public static int 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.
      • 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.
      • 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.