Top Description Inners Fields Constructors Methods
org.lwjgl.util.vma

public Class VmaAllocationInfo

extends Struct<VmaAllocationInfo>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

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;
    char const * pName;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
DEVICEMEMORY

The struct member offsets.

public static final int
MEMORYTYPE

The struct member offsets.

public static final int
OFFSET

The struct member offsets.

public static final int
PMAPPEDDATA

The struct member offsets.

public static final int
PNAME

The struct member offsets.

public static final int
PUSERDATA

The struct member offsets.

public static final int
SIZE

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
VmaAllocationInfo(long address, ByteBuffer container)

public
VmaAllocationInfo(ByteBuffer container)

Creates a VmaAllocationInfo instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static VmaAllocationInfo
calloc()

Returns a new VmaAllocationInfo instance allocated with memCalloc.

public static VmaAllocationInfo.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new VmaAllocationInfo.Buffer instance allocated with memCalloc.

public static VmaAllocationInfo
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VmaAllocationInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VmaAllocationInfo.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VmaAllocationInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VmaAllocationInfo
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VmaAllocationInfo
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VmaAllocationInfo.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VmaAllocationInfo.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
protected VmaAllocationInfo
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static VmaAllocationInfo
create()

Returns a new VmaAllocationInfo instance allocated with BufferUtils.

public static VmaAllocationInfo
create(long address)

Returns a new VmaAllocationInfo instance for the specified memory address.

public static VmaAllocationInfo.Buffer
create(int
the buffer capacity
capacity
)

Returns a new VmaAllocationInfo.Buffer instance allocated with BufferUtils.

public static VmaAllocationInfo.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a VmaAllocationInfo.Buffer instance at the specified memory.

public static VmaAllocationInfo
createSafe(long address)

Like create, but returns null if address is NULL.

public static VmaAllocationInfo.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public long
deviceMemory()

handle to Vulkan memory object.

public static VmaAllocationInfo
malloc()

Returns a new VmaAllocationInfo instance allocated with memAlloc.

public static VmaAllocationInfo.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new VmaAllocationInfo.Buffer instance allocated with memAlloc.

public static VmaAllocationInfo
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VmaAllocationInfo instance allocated on the specified MemoryStack.

public static VmaAllocationInfo.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VmaAllocationInfo.Buffer instance allocated on the specified MemoryStack.

public static VmaAllocationInfo
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VmaAllocationInfo
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VmaAllocationInfo.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VmaAllocationInfo.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public int
memoryType()

memory type index that this allocation was allocated from.

public static long
ndeviceMemory(long struct)

Unsafe version of deviceMemory.

public static int
nmemoryType(long struct)

Unsafe version of memoryType.

public static long
noffset(long struct)

Unsafe version of offset.

public static long
npMappedData(long struct)

Unsafe version of pMappedData.

public static ByteBuffer
npName(long struct)

Unsafe version of pName.

public static String
npNameString(long struct)

Unsafe version of pNameString.

public static long
npUserData(long struct)

Unsafe version of pUserData.

public static long
nsize(long struct)

Unsafe version of size.

public long
offset()

offset in VkDeviceMemory object to the beginning of this allocation, in bytes.

public long
pMappedData()

pointer to the beginning of this allocation as mapped data.

public ByteBuffer
pName()

Custom allocation name that was set with SetAllocationName.

public String
pNameString()

Custom allocation name that was set with SetAllocationName.

public long
pUserData()

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

public long
size()

size of this allocation, in bytes.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

DEVICEMEMORYback to summary
public static final int DEVICEMEMORY

The struct member offsets.

MEMORYTYPEback to summary
public static final int MEMORYTYPE

The struct member offsets.

OFFSETback to summary
public static final int OFFSET

The struct member offsets.

PMAPPEDDATAback to summary
public static final int PMAPPEDDATA

The struct member offsets.

PNAMEback to summary
public static final int PNAME

The struct member offsets.

PUSERDATAback to summary
public static final int PUSERDATA

The struct member offsets.

SIZEback to summary
public static final int SIZE

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

Constructor Detail

VmaAllocationInfoback to summary
protected VmaAllocationInfo(long address, ByteBuffer container)
VmaAllocationInfoback to summary
public VmaAllocationInfo(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

callocback to summary
public static VmaAllocationInfo calloc()

Returns a new VmaAllocationInfo instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static VmaAllocationInfo.Buffer calloc(int capacity)

Returns a new VmaAllocationInfo.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
public static VmaAllocationInfo calloc(MemoryStack stack)

Returns a new VmaAllocationInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocback to summary
public static VmaAllocationInfo.Buffer calloc(int capacity, MemoryStack stack)

Returns a new VmaAllocationInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static VmaAllocationInfo callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VmaAllocationInfo callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VmaAllocationInfo.Buffer callocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VmaAllocationInfo.Buffer callocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
createback to summary
protected VmaAllocationInfo create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static VmaAllocationInfo create()

Returns a new VmaAllocationInfo instance allocated with BufferUtils.

createback to summary
public static VmaAllocationInfo create(long address)

Returns a new VmaAllocationInfo instance for the specified memory address.

createback to summary
public static VmaAllocationInfo.Buffer create(int capacity)

Returns a new VmaAllocationInfo.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static VmaAllocationInfo.Buffer create(long address, int capacity)

Create a VmaAllocationInfo.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static VmaAllocationInfo createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static VmaAllocationInfo.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
deviceMemoryback to summary
public long deviceMemory()

handle to Vulkan memory object.

Same memory object can be shared by multiple allocations.

It can change after the allocation is moved during defragmentation.

Annotations
@NativeType:VkDeviceMemory
mallocback to summary
public static VmaAllocationInfo malloc()

Returns a new VmaAllocationInfo instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static VmaAllocationInfo.Buffer malloc(int capacity)

Returns a new VmaAllocationInfo.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static VmaAllocationInfo malloc(MemoryStack stack)

Returns a new VmaAllocationInfo instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static VmaAllocationInfo.Buffer malloc(int capacity, MemoryStack stack)

Returns a new VmaAllocationInfo.Buffer instance allocated on the specified MemoryStack.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static VmaAllocationInfo mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VmaAllocationInfo mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VmaAllocationInfo.Buffer mallocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VmaAllocationInfo.Buffer mallocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
memoryTypeback to summary
public int memoryType()

memory type index that this allocation was allocated from.

It never changes.

Annotations
@NativeType:uint32_t
ndeviceMemoryback to summary
public static long ndeviceMemory(long struct)

Unsafe version of deviceMemory.

nmemoryTypeback to summary
public static int nmemoryType(long struct)

Unsafe version of memoryType.

noffsetback to summary
public static long noffset(long struct)

Unsafe version of offset.

npMappedDataback to summary
public static long npMappedData(long struct)

Unsafe version of pMappedData.

npNameback to summary
public static ByteBuffer npName(long struct)

Unsafe version of pName.

Annotations
@Nullable
npNameStringback to summary
public static String npNameString(long struct)

Unsafe version of pNameString.

Annotations
@Nullable
npUserDataback to summary
public static long npUserData(long struct)

Unsafe version of pUserData.

nsizeback to summary
public static long nsize(long struct)

Unsafe version of size.

offsetback to summary
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 the allocation is moved during defragmentation.

Annotations
@NativeType:VkDeviceSize
pMappedDataback to summary
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 the allocation is moved during defragmentation.

Annotations
@NativeType:void *
pNameback to summary
public ByteBuffer pName()

Custom allocation name that was set with SetAllocationName.

It can change after call to vmaSetAllocationName() for this allocation.

Another way to set custom name is to pass it in VmaAllocationCreateInfo::pUserData with additional flag ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT set (DEPRECATED).

Annotations
@Nullable
@NativeType:char const *
pNameStringback to summary
public String pNameString()

Custom allocation name that was set with SetAllocationName.

It can change after call to vmaSetAllocationName() for this allocation.

Another way to set custom name is to pass it in VmaAllocationCreateInfo::pUserData with additional flag ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT set (DEPRECATED).

Annotations
@Nullable
@NativeType:char const *
pUserDataback to summary
public long 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.

Annotations
@NativeType:void *
sizeback to summary
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.

Annotations
@NativeType:VkDeviceSize
sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
org.lwjgl.util.vma back to summary

public Class VmaAllocationInfo.Buffer

extends StructBuffer<VmaAllocationInfo, VmaAllocationInfo.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of VmaAllocationInfo structs.

Field Summary

Modifier and TypeField and Description
private static final VmaAllocationInfo

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new VmaAllocationInfo.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the value of the VmaAllocationInfo#deviceMemory field.
deviceMemory
()

protected VmaAllocationInfo
public int

Returns:

the value of the VmaAllocationInfo#memoryType field.
memoryType
()

public long

Returns:

the value of the VmaAllocationInfo#offset field.
offset
()

public long

Returns:

the value of the VmaAllocationInfo#pMappedData field.
pMappedData
()

public ByteBuffer

Returns:

a ByteBuffer view of the null-terminated string pointed to by the VmaAllocationInfo#pName field.
pName
()

public String

Returns:

the null-terminated string pointed to by the VmaAllocationInfo#pName field.
pNameString
()

public long

Returns:

the value of the VmaAllocationInfo#pUserData field.
pUserData
()

protected VmaAllocationInfo.Buffer
public long

Returns:

the value of the VmaAllocationInfo#size field.
size
()

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final VmaAllocationInfo ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new VmaAllocationInfo.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by VmaAllocationInfo#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

deviceMemoryback to summary
public long deviceMemory()
Returns:long

the value of the VmaAllocationInfo#deviceMemory field.

Annotations
@NativeType:VkDeviceMemory
getElementFactoryback to summary
protected VmaAllocationInfo getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
memoryTypeback to summary
public int memoryType()
Returns:int

the value of the VmaAllocationInfo#memoryType field.

Annotations
@NativeType:uint32_t
offsetback to summary
public long offset()
Returns:long

the value of the VmaAllocationInfo#offset field.

Annotations
@NativeType:VkDeviceSize
pMappedDataback to summary
public long pMappedData()
Returns:long

the value of the VmaAllocationInfo#pMappedData field.

Annotations
@NativeType:void *
pNameback to summary
public ByteBuffer pName()
Returns:ByteBuffer

a ByteBuffer view of the null-terminated string pointed to by the VmaAllocationInfo#pName field.

Annotations
@Nullable
@NativeType:char const *
pNameStringback to summary
public String pNameString()
Returns:String

the null-terminated string pointed to by the VmaAllocationInfo#pName field.

Annotations
@Nullable
@NativeType:char const *
pUserDataback to summary
public long pUserData()
Returns:long

the value of the VmaAllocationInfo#pUserData field.

Annotations
@NativeType:void *
selfback to summary
protected VmaAllocationInfo.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
sizeback to summary
public long size()
Returns:long

the value of the VmaAllocationInfo#size field.

Annotations
@NativeType:VkDeviceSize