Class VmaAllocationInfo

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

    public class VmaAllocationInfo
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Parameters of VmaAllocation objects, that can be retrieved using function GetAllocationInfo.

    Layout

    
     struct VmaAllocationInfo {
         uint32_t memoryType();
         VkDeviceMemory deviceMemory();
         VkDeviceSize offset();
         VkDeviceSize size();
         void * pMappedData();
         void * pUserData();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MEMORYTYPE, DEVICEMEMORY, OFFSET, SIZE, PMAPPEDDATA, PUSERDATA

        The struct member offsets.
    • Constructor Detail

      • VmaAllocationInfo

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

        public int memoryType()
        memory type index that this allocation was allocated from.

        It never changes.

      • deviceMemory

        public long deviceMemory()
        handle to Vulkan memory object.

        Same memory object can be shared by multiple allocations.

        It can change after call to Defragment if this allocation is passed to the function.

      • offset

        public long offset()
        offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.

        You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function CreateBuffer, CreateImage, functions that operate on these resources refer to the beginning of the buffer or image, not entire device memory block. Functions like MapMemory, BindBufferMemory also refer to the beginning of the allocation and apply this offset automatically.

        It can change after call to Defragment if this allocation is passed to the function.

      • size

        public long size()
        size of this allocation, in bytes.

        It never changes.

        Note

        Allocation size returned in this variable may be greater than the size requested for the resource e.g. as VkBufferCreateInfo::size. Whole size of the allocation is accessible for operations on memory e.g. using a pointer after mapping with MapMemory, but operations on the resource e.g. using vkCmdCopyBuffer must be limited to the size of the resource.

      • pMappedData

        public long pMappedData()
        pointer to the beginning of this allocation as mapped data.

        If the allocation hasn't been mapped using MapMemory and hasn't been created with ALLOCATION_CREATE_MAPPED_BIT flag, this value is null.

        It can change after call to MapMemory, UnmapMemory. It can also change after call to Defragment if this allocation is passed to the function.

      • malloc

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

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

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

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

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

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

        @Deprecated
        public static VmaAllocationInfo mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static VmaAllocationInfo callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • malloc

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

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

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

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

        public static int nmemoryType​(long struct)
        Unsafe version of memoryType().
      • ndeviceMemory

        public static long ndeviceMemory​(long struct)
        Unsafe version of deviceMemory().
      • noffset

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

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

        public static long npMappedData​(long struct)
        Unsafe version of pMappedData().
      • npUserData

        public static long npUserData​(long struct)
        Unsafe version of pUserData().