Class VmaAllocationCreateInfo
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
VmaAllocation.
To be used with functions like CreateBuffer, CreateImage, and many others.
Layout
struct VmaAllocationCreateInfo {
VmaAllocationCreateFlags flags();
VmaMemoryUsage usage();
VkMemoryPropertyFlags requiredFlags();
VkMemoryPropertyFlags preferredFlags();
uint32_t memoryTypeBits();
VmaPool pool();
void * pUserData();
float priority();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVmaAllocationCreateInfo(ByteBuffer container) Creates aVmaAllocationCreateInfoinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaAllocationCreateInfocalloc()Returns a newVmaAllocationCreateInfoinstance allocated withmemCalloc.calloc(int capacity) Returns a newVmaAllocationCreateInfo.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocationCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VmaAllocationCreateInfocalloc(org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocationCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VmaAllocationCreateInfoDeprecated.callocStack(int capacity) Deprecated.callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VmaAllocationCreateInfocallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static VmaAllocationCreateInfocreate()Returns a newVmaAllocationCreateInfoinstance allocated withBufferUtils.create(int capacity) Returns a newVmaAllocationCreateInfo.Bufferinstance allocated withBufferUtils.static VmaAllocationCreateInfocreate(long address) Returns a newVmaAllocationCreateInfoinstance for the specified memory address.create(long address, int capacity) Create aVmaAllocationCreateInfo.Bufferinstance at the specified memory.static @Nullable VmaAllocationCreateInfocreateSafe(long address) static @Nullable VmaAllocationCreateInfo.BuffercreateSafe(long address, int capacity) intflags()useVmaAllocationCreateFlagBitsenum.flags(int value) Sets the specified value to theflags()field.static VmaAllocationCreateInfomalloc()Returns a newVmaAllocationCreateInfoinstance allocated withmemAlloc.malloc(int capacity) Returns a newVmaAllocationCreateInfo.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocationCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.static VmaAllocationCreateInfomalloc(org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocationCreateInfoinstance allocated on the specifiedMemoryStack.static VmaAllocationCreateInfoDeprecated.mallocStack(int capacity) Deprecated.mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VmaAllocationCreateInfomallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.intbitmask containing one bit set for every memory type acceptable for this allocation.memoryTypeBits(int value) Sets the specified value to thememoryTypeBits()field.static intnflags(long struct) Unsafe version offlags().static voidnflags(long struct, int value) Unsafe version offlags.static intnmemoryTypeBits(long struct) Unsafe version ofmemoryTypeBits().static voidnmemoryTypeBits(long struct, int value) Unsafe version ofmemoryTypeBits.static longnpool(long struct) Unsafe version ofpool().static voidnpool(long struct, long value) Unsafe version ofpool.static intnpreferredFlags(long struct) Unsafe version ofpreferredFlags().static voidnpreferredFlags(long struct, int value) Unsafe version ofpreferredFlags.static floatnpriority(long struct) Unsafe version ofpriority().static voidnpriority(long struct, float value) Unsafe version ofpriority.static longnpUserData(long struct) Unsafe version ofpUserData().static voidnpUserData(long struct, long value) Unsafe version ofpUserData.static intnrequiredFlags(long struct) Unsafe version ofrequiredFlags().static voidnrequiredFlags(long struct, int value) Unsafe version ofrequiredFlags.static intnusage(long struct) Unsafe version ofusage().static voidnusage(long struct, int value) Unsafe version ofusage.longpool()pool that this allocation should be created in.pool(long value) Sets the specified value to thepool()field.intflags that preferably should be set in a memory type chosen for an allocation.preferredFlags(int value) Sets the specified value to thepreferredFlags()field.floatpriority()A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.priority(float value) Sets the specified value to thepriority()field.longcustom general-purpose pointer that will be stored inVmaAllocation, can be read asVmaAllocationInfo::pUserDataand changed usingSetAllocationUserData.pUserData(long value) Sets the specified value to thepUserData()field.intflags that must be set in a Memory Type chosen for an allocation.requiredFlags(int value) Sets the specified value to therequiredFlags()field.set(int flags, int usage, int requiredFlags, int preferredFlags, int memoryTypeBits, long pool, long pUserData, float priority) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()intusage()intended usage of memory.usage(int value) Sets the specified value to theusage()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
FLAGS
public static final int FLAGSThe struct member offsets. -
USAGE
public static final int USAGEThe struct member offsets. -
REQUIREDFLAGS
public static final int REQUIREDFLAGSThe struct member offsets. -
PREFERREDFLAGS
public static final int PREFERREDFLAGSThe struct member offsets. -
MEMORYTYPEBITS
public static final int MEMORYTYPEBITSThe struct member offsets. -
POOL
public static final int POOLThe struct member offsets. -
PUSERDATA
public static final int PUSERDATAThe struct member offsets. -
PRIORITY
public static final int PRIORITYThe struct member offsets.
-
-
Constructor Details
-
VmaAllocationCreateInfo
Creates aVmaAllocationCreateInfoinstance 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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VmaAllocationCreateInfo>
-
flags
public int flags()useVmaAllocationCreateFlagBitsenum. One or more of: -
usage
public int usage()intended usage of memory.You can leave
MEMORY_USAGE_UNKNOWNif you specify memory requirements in other way. Ifpoolis not null, this member is ignored. One of: -
requiredFlags
public int requiredFlags()flags that must be set in a Memory Type chosen for an allocation.Leave 0 if you specify memory requirements in other way. If
poolis not null, this member is ignored. -
preferredFlags
public int preferredFlags()flags that preferably should be set in a memory type chosen for an allocation.Set to 0 if no additional flags are preferred. If
poolis not null, this member is ignored. -
memoryTypeBits
public int memoryTypeBits()bitmask containing one bit set for every memory type acceptable for this allocation.Value 0 is equivalent to
UINT32_MAX- it means any memory type is accepted if it meets other requirements specified by this structure, with no further restrictions on memory type index. Ifpoolis not null, this member is ignored. -
pool
public long pool()pool that this allocation should be created in.Leave
VK_NULL_HANDLEto allocate from default pool. If not null, members:usage,requiredFlags,preferredFlags,memoryTypeBitsare ignored. -
pUserData
public long pUserData()custom general-purpose pointer that will be stored inVmaAllocation, can be read asVmaAllocationInfo::pUserDataand changed usingSetAllocationUserData.If
ALLOCATION_CREATE_USER_DATA_COPY_STRING_BITis used, it must be either null or pointer to a null-terminated string. The string will be then copied to internal buffer, so it doesn't need to be valid after allocation call. -
priority
public float priority()A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.It is used only when
ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BITflag was used during creation of theVmaAllocatorobject and this allocation ends up as dedicated or is explicitly forced as dedicated usingALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Otherwise, it has the priority of a memory block where it is placed and this variable is ignored. -
flags
Sets the specified value to theflags()field. -
usage
Sets the specified value to theusage()field. -
requiredFlags
Sets the specified value to therequiredFlags()field. -
preferredFlags
Sets the specified value to thepreferredFlags()field. -
memoryTypeBits
Sets the specified value to thememoryTypeBits()field. -
pool
Sets the specified value to thepool()field. -
pUserData
Sets the specified value to thepUserData()field. -
priority
Sets the specified value to thepriority()field. -
set
public VmaAllocationCreateInfo set(int flags, int usage, int requiredFlags, int preferredFlags, int memoryTypeBits, long pool, long pUserData, float priority) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVmaAllocationCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVmaAllocationCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVmaAllocationCreateInfoinstance allocated withBufferUtils. -
create
Returns a newVmaAllocationCreateInfoinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVmaAllocationCreateInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVmaAllocationCreateInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVmaAllocationCreateInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVmaAllocationCreateInfo.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
mallocStack
@Deprecated public static VmaAllocationCreateInfo.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 VmaAllocationCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newVmaAllocationCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVmaAllocationCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VmaAllocationCreateInfo.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocationCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VmaAllocationCreateInfo.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocationCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nflags
public static int nflags(long struct) Unsafe version offlags(). -
nusage
public static int nusage(long struct) Unsafe version ofusage(). -
nrequiredFlags
public static int nrequiredFlags(long struct) Unsafe version ofrequiredFlags(). -
npreferredFlags
public static int npreferredFlags(long struct) Unsafe version ofpreferredFlags(). -
nmemoryTypeBits
public static int nmemoryTypeBits(long struct) Unsafe version ofmemoryTypeBits(). -
npool
public static long npool(long struct) Unsafe version ofpool(). -
npUserData
public static long npUserData(long struct) Unsafe version ofpUserData(). -
npriority
public static float npriority(long struct) Unsafe version ofpriority(). -
nflags
public static void nflags(long struct, int value) Unsafe version offlags. -
nusage
public static void nusage(long struct, int value) Unsafe version ofusage. -
nrequiredFlags
public static void nrequiredFlags(long struct, int value) Unsafe version ofrequiredFlags. -
npreferredFlags
public static void npreferredFlags(long struct, int value) Unsafe version ofpreferredFlags. -
nmemoryTypeBits
public static void nmemoryTypeBits(long struct, int value) Unsafe version ofmemoryTypeBits. -
npool
public static void npool(long struct, long value) Unsafe version ofpool. -
npUserData
public static void npUserData(long struct, long value) Unsafe version ofpUserData. -
npriority
public static void npriority(long struct, float value) Unsafe version ofpriority.
-