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.NativeResource
Parameters ofVmaAllocation
objects, that can be retrieved using functionGetAllocationInfo
.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 intodeviceMemory
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 withALLOCATION_CREATE_MAPPED_BIT
flag, this value null.It can change after call to
MapMemory
,UnmapMemory
. It can also change after call toDefragment
if this allocation is passed to the function.pUserData
– custom general-purpose pointer that was passed asVmaAllocationCreateInfo
::pUserData
or set usingSetAllocationUserData
.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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VmaAllocationInfo.Buffer
An array ofVmaAllocationInfo
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
DEVICEMEMORY
MEMORYTYPE
OFFSET
PMAPPEDDATA
PUSERDATA
SIZEThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VmaAllocationInfo(java.nio.ByteBuffer container)
Creates aVmaAllocationInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VmaAllocationInfo
calloc()
Returns a newVmaAllocationInfo
instance allocated withmemCalloc
.static VmaAllocationInfo.Buffer
calloc(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated withmemCalloc
.static VmaAllocationInfo
callocStack()
Returns a newVmaAllocationInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaAllocationInfo.Buffer
callocStack(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaAllocationInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaAllocationInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaAllocationInfo
create()
Returns a newVmaAllocationInfo
instance allocated withBufferUtils
.static VmaAllocationInfo.Buffer
create(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated withBufferUtils
.static VmaAllocationInfo
create(long address)
Returns a newVmaAllocationInfo
instance for the specified memory address.static VmaAllocationInfo.Buffer
create(long address, int capacity)
Create aVmaAllocationInfo.Buffer
instance at the specified memory.static VmaAllocationInfo
createSafe(long address)
static VmaAllocationInfo.Buffer
createSafe(long address, int capacity)
long
deviceMemory()
Returns the value of thedeviceMemory
field.static VmaAllocationInfo
malloc()
Returns a newVmaAllocationInfo
instance allocated withmemAlloc
.static VmaAllocationInfo.Buffer
malloc(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated withmemAlloc
.static VmaAllocationInfo
mallocStack()
Returns a newVmaAllocationInfo
instance allocated on the thread-localMemoryStack
.static VmaAllocationInfo.Buffer
mallocStack(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VmaAllocationInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VmaAllocationInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo
instance allocated on the specifiedMemoryStack
.int
memoryType()
Returns the value of thememoryType
field.static long
ndeviceMemory(long struct)
Unsafe version ofdeviceMemory()
.static int
nmemoryType(long struct)
Unsafe version ofmemoryType()
.static long
noffset(long struct)
Unsafe version ofoffset()
.static long
npMappedData(long struct)
Unsafe version ofpMappedData()
.static long
npUserData(long struct)
Unsafe version ofpUserData()
.static long
nsize(long struct)
Unsafe version ofsize()
.long
offset()
Returns the value of theoffset
field.long
pMappedData()
Returns the value of thepMappedData
field.long
pUserData()
Returns the value of thepUserData
field.long
size()
Returns the value of thesize
field.int
sizeof()
-
-
-
Constructor Detail
-
VmaAllocationInfo
public VmaAllocationInfo(java.nio.ByteBuffer container)
Creates aVmaAllocationInfo
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
memoryType
public int memoryType()
Returns the value of thememoryType
field.
-
deviceMemory
public long deviceMemory()
Returns the value of thedeviceMemory
field.
-
offset
public long offset()
Returns the value of theoffset
field.
-
size
public long size()
Returns the value of thesize
field.
-
pMappedData
public long pMappedData()
Returns the value of thepMappedData
field.
-
pUserData
public long pUserData()
Returns the value of thepUserData
field.
-
malloc
public static VmaAllocationInfo malloc()
Returns a newVmaAllocationInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VmaAllocationInfo calloc()
Returns a newVmaAllocationInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VmaAllocationInfo create()
Returns a newVmaAllocationInfo
instance allocated withBufferUtils
.
-
create
public static VmaAllocationInfo create(long address)
Returns a newVmaAllocationInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VmaAllocationInfo createSafe(long address)
-
malloc
public static VmaAllocationInfo.Buffer malloc(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VmaAllocationInfo.Buffer calloc(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaAllocationInfo.Buffer create(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaAllocationInfo.Buffer create(long address, int capacity)
Create aVmaAllocationInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VmaAllocationInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VmaAllocationInfo mallocStack()
Returns a newVmaAllocationInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VmaAllocationInfo callocStack()
Returns a newVmaAllocationInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VmaAllocationInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VmaAllocationInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VmaAllocationInfo.Buffer mallocStack(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VmaAllocationInfo.Buffer callocStack(int capacity)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VmaAllocationInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VmaAllocationInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationInfo.Buffer
instance allocated on the specifiedMemoryStack
and 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()
.
-
-