Class VmaAllocationInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.vma.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.NativeResourceParameters ofVmaAllocationobjects, that can be retrieved using functionGetAllocationInfo.Layout
struct VmaAllocationInfo { uint32_tmemoryType(); VkDeviceMemorydeviceMemory(); VkDeviceSizeoffset(); VkDeviceSizesize(); void *pMappedData(); void *pUserData(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVmaAllocationInfo.BufferAn array ofVmaAllocationInfostructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intDEVICEMEMORY
MEMORYTYPE
OFFSET
PMAPPEDDATA
PUSERDATA
SIZEThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VmaAllocationInfo(java.nio.ByteBuffer container)Creates aVmaAllocationInfoinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static VmaAllocationInfocalloc()Returns a newVmaAllocationInfoinstance allocated withmemCalloc.static VmaAllocationInfo.Buffercalloc(int capacity)Returns a newVmaAllocationInfo.Bufferinstance allocated withmemCalloc.static VmaAllocationInfo.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVmaAllocationInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VmaAllocationInfocalloc(org.lwjgl.system.MemoryStack stack)Returns a newVmaAllocationInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VmaAllocationInfocallocStack()Deprecated.static VmaAllocationInfo.BuffercallocStack(int capacity)Deprecated.static VmaAllocationInfo.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VmaAllocationInfocallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static VmaAllocationInfocreate()Returns a newVmaAllocationInfoinstance allocated withBufferUtils.static VmaAllocationInfo.Buffercreate(int capacity)Returns a newVmaAllocationInfo.Bufferinstance allocated withBufferUtils.static VmaAllocationInfocreate(long address)Returns a newVmaAllocationInfoinstance for the specified memory address.static VmaAllocationInfo.Buffercreate(long address, int capacity)Create aVmaAllocationInfo.Bufferinstance at the specified memory.static VmaAllocationInfocreateSafe(long address)static VmaAllocationInfo.BuffercreateSafe(long address, int capacity)longdeviceMemory()handle to Vulkan memory object.static VmaAllocationInfomalloc()Returns a newVmaAllocationInfoinstance allocated withmemAlloc.static VmaAllocationInfo.Buffermalloc(int capacity)Returns a newVmaAllocationInfo.Bufferinstance allocated withmemAlloc.static VmaAllocationInfo.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVmaAllocationInfo.Bufferinstance allocated on the specifiedMemoryStack.static VmaAllocationInfomalloc(org.lwjgl.system.MemoryStack stack)Returns a newVmaAllocationInfoinstance allocated on the specifiedMemoryStack.static VmaAllocationInfomallocStack()Deprecated.static VmaAllocationInfo.BuffermallocStack(int capacity)Deprecated.static VmaAllocationInfo.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VmaAllocationInfomallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.intmemoryType()memory type index that this allocation was allocated from.static longndeviceMemory(long struct)Unsafe version ofdeviceMemory().static intnmemoryType(long struct)Unsafe version ofmemoryType().static longnoffset(long struct)Unsafe version ofoffset().static longnpMappedData(long struct)Unsafe version ofpMappedData().static longnpUserData(long struct)Unsafe version ofpUserData().static longnsize(long struct)Unsafe version ofsize().longoffset()offset inVkDeviceMemoryobject to the beginning of this allocation, in bytes.longpMappedData()pointer to the beginning of this allocation as mapped data.longpUserData()custom general-purpose pointer that was passed asVmaAllocationCreateInfo::pUserDataor set usingSetAllocationUserData.longsize()size of this allocation, in bytes.intsizeof()
-
-
-
Constructor Detail
-
VmaAllocationInfo
public VmaAllocationInfo(java.nio.ByteBuffer container)
Creates aVmaAllocationInfoinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.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
Defragmentif this allocation is passed to the function.
-
offset
public long offset()
offset inVkDeviceMemoryobject 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 likeMapMemory,BindBufferMemoryalso refer to the beginning of the allocation and apply this offset automatically.It can change after call to
Defragmentif 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 withMapMemory, but operations on the resource e.g. usingvkCmdCopyBuffermust 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
MapMemoryand hasn't been created withALLOCATION_CREATE_MAPPED_BITflag, this value is null.It can change after call to
MapMemory,UnmapMemory. It can also change after call toDefragmentif this allocation is passed to the function.
-
pUserData
public long pUserData()
custom general-purpose pointer that was passed asVmaAllocationCreateInfo::pUserDataor set usingSetAllocationUserData.It can change after call to
SetAllocationUserDatafor this allocation.
-
malloc
public static VmaAllocationInfo malloc()
Returns a newVmaAllocationInfoinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VmaAllocationInfo calloc()
Returns a newVmaAllocationInfoinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VmaAllocationInfo create()
Returns a newVmaAllocationInfoinstance allocated withBufferUtils.
-
create
public static VmaAllocationInfo create(long address)
Returns a newVmaAllocationInfoinstance for the specified memory address.
-
createSafe
@Nullable public static VmaAllocationInfo createSafe(long address)
-
malloc
public static VmaAllocationInfo.Buffer malloc(int capacity)
Returns a newVmaAllocationInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VmaAllocationInfo.Buffer calloc(int capacity)
Returns a newVmaAllocationInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VmaAllocationInfo.Buffer create(int capacity)
Returns a newVmaAllocationInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VmaAllocationInfo.Buffer create(long address, int capacity)
Create aVmaAllocationInfo.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VmaAllocationInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static VmaAllocationInfo mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VmaAllocationInfo callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VmaAllocationInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VmaAllocationInfo callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VmaAllocationInfo.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VmaAllocationInfo.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static VmaAllocationInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VmaAllocationInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static VmaAllocationInfo malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VmaAllocationInfo calloc(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfoinstance allocated on the specifiedMemoryStackand 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 newVmaAllocationInfo.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static VmaAllocationInfo.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nmemoryType
public static int nmemoryType(long struct)
Unsafe version ofmemoryType().
-
ndeviceMemory
public static long ndeviceMemory(long struct)
Unsafe version ofdeviceMemory().
-
noffset
public static long noffset(long struct)
Unsafe version ofoffset().
-
nsize
public static long nsize(long struct)
Unsafe version ofsize().
-
npMappedData
public static long npMappedData(long struct)
Unsafe version ofpMappedData().
-
npUserData
public static long npUserData(long struct)
Unsafe version ofpUserData().
-
-