Class VkBufferMemoryBarrier

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

    public class VkBufferMemoryBarrier
    extends Struct
    implements 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
    Valid Usage (Implicit)
    • sType must be STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
    • pNext must be NULL
    • srcAccessMask must be a valid combination of VkAccessFlagBits values
    • dstAccessMask must be a valid combination of VkAccessFlagBits values
    • buffer must be a valid VkBuffer handle
    See Also

    CmdPipelineBarrier, CmdWaitEvents

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • srcAccessMask – a bitmask of VkAccessFlagBits specifying a source access mask.
    • dstAccessMask – a bitmask of VkAccessFlagBits specifying a destination access mask.
    • srcQueueFamilyIndex – the source queue family for a queue family ownership transfer.
    • dstQueueFamilyIndex – the destination queue family for a queue family ownership transfer.
    • buffer – a handle to the buffer whose backing memory is affected by the barrier.
    • 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 – 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.

    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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • sType

        public int sType()
        Returns the value of the sType field.
      • pNext

        public long pNext()
        Returns the value of the pNext field.
      • srcAccessMask

        public int srcAccessMask()
        Returns the value of the srcAccessMask field.
      • dstAccessMask

        public int dstAccessMask()
        Returns the value of the dstAccessMask field.
      • srcQueueFamilyIndex

        public int srcQueueFamilyIndex()
        Returns the value of the srcQueueFamilyIndex field.
      • dstQueueFamilyIndex

        public int dstQueueFamilyIndex()
        Returns the value of the dstQueueFamilyIndex field.
      • buffer

        public long buffer()
        Returns the value of the buffer field.
      • offset

        public long offset()
        Returns the value of the offset field.
      • size

        public long size()
        Returns the value of the size field.
      • pNext

        public VkBufferMemoryBarrier pNext​(long value)
        Sets the specified value to the pNext field.
      • srcAccessMask

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

        public VkBufferMemoryBarrier dstAccessMask​(int value)
        Sets the specified value to the dstAccessMask field.
      • srcQueueFamilyIndex

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

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

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

        public VkBufferMemoryBarrier offset​(long value)
        Sets the specified value to the offset field.
      • 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.
      • createSafe

        @Nullable
        public static VkBufferMemoryBarrier createSafe​(long address)
        Like create, but returns null if address is NULL.
      • 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.