Class VmaAllocationInfo

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

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

    Member documentation

    • memoryType – memory type index that this allocation was allocated from.

      It never changes.

    • 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, or if allocation is lost.

      If the allocation is lost, it is equal to VK_NULL_HANDLE.

    • offset – offset into deviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.

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

    • size – size of this allocation, in bytes.

      It never changes, unless allocation is lost.

    • 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 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.

    • pUserData – custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using SetAllocationUserData.

      It can change after call to SetAllocationUserData for this allocation.

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

        public int memoryType()
        Returns the value of the memoryType field.
      • deviceMemory

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

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

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

        public long pMappedData()
        Returns the value of the pMappedData field.
      • pUserData

        public long pUserData()
        Returns the value of the pUserData field.
      • 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​(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

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

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

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

        public static VmaAllocationInfo callocStack​(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
      • 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().