Class VkDescriptorBufferInfo

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

    public class VkDescriptorBufferInfo
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying descriptor buffer info.
    Description
    Note

    When setting range to WHOLE_SIZE, the effective range must not be larger than the maximum range for the descriptor type (maxUniformBufferRange or maxStorageBufferRange). This means that WHOLE_SIZE is not typically useful in the common case where uniform buffer descriptors are suballocated from a buffer that is much larger than maxUniformBufferRange.

    For DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC and DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC descriptor types, offset is the base offset from which the dynamic offset is applied and range is the static size used for all dynamic offsets.

    Valid Usage
    • offset must be less than the size of buffer
    • If range is not equal to WHOLE_SIZE, range must be greater than 0
    • If range is not equal to WHOLE_SIZE, range must be less than or equal to the size of buffer minus offset
    Valid Usage (Implicit)
    • buffer must be a valid VkBuffer handle
    See Also

    VkWriteDescriptorSet

    Member documentation

    • buffer – the buffer resource.
    • offset – the offset in bytes from the start of buffer. Access to buffer memory via this descriptor uses addressing that is relative to this starting offset.
    • range – the size in bytes that is used for this descriptor update, or WHOLE_SIZE to use the range from offset to the end of the buffer.

    Layout

    
     struct VkDescriptorBufferInfo {
         VkBuffer buffer;
         VkDeviceSize offset;
         VkDeviceSize range;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • BUFFER, OFFSET, RANGE

        The struct member offsets.
    • Constructor Detail

      • VkDescriptorBufferInfo

        public VkDescriptorBufferInfo​(java.nio.ByteBuffer container)
        Creates a VkDescriptorBufferInfo 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
      • buffer

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

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

        public long range()
        Returns the value of the range field.
      • set

        public VkDescriptorBufferInfo set​(long buffer,
                                          long offset,
                                          long range)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

        public static VkDescriptorBufferInfo mallocStack()
        Returns a new VkDescriptorBufferInfo instance allocated on the thread-local MemoryStack.
      • callocStack

        public static VkDescriptorBufferInfo callocStack()
        Returns a new VkDescriptorBufferInfo instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

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

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

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

        public static VkDescriptorBufferInfo.Buffer callocStack​(int capacity,
                                                                org.lwjgl.system.MemoryStack stack)
        Returns a new VkDescriptorBufferInfo.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
      • nbuffer

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

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

        public static long nrange​(long struct)
        Unsafe version of range().
      • 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.
      • nrange

        public static void nrange​(long struct,
                                  long value)
        Unsafe version of range.