Class VmaAllocationCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.vma.VmaAllocationCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VmaAllocationCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Member documentation
flags
– useVmaAllocationCreateFlagBits
enum. One or more of:usage
– intended usage of memory.You can leave
MEMORY_USAGE_UNKNOWN
if you specify memory requirements in other way. Ifpool
is not null, this member is ignored. One of:MEMORY_USAGE_UNKNOWN
MEMORY_USAGE_GPU_ONLY
MEMORY_USAGE_CPU_ONLY
MEMORY_USAGE_CPU_TO_GPU
MEMORY_USAGE_GPU_TO_CPU
MEMORY_USAGE_CPU_COPY
MEMORY_USAGE_GPU_LAZILY_ALLOCATED
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
pool
is not null, this member is ignored.preferredFlags
– flags that preferably should be set in a memory type chosen for an allocation.Set to 0 if no additional flags are prefered. If
pool
is not null, this member is ignored.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. Ifpool
is not null, this member is ignored.pool
– pool that this allocation should be created in.Leave
VK_NULL_HANDLE
to allocate from default pool. If not null, members:usage
,requiredFlags
,preferredFlags
,memoryTypeBits
are ignored.pUserData
– custom general-purpose pointer that will be stored inVmaAllocation
, can be read asVmaAllocationInfo
::pUserData
and changed usingSetAllocationUserData
.If
ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
is 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.
Layout
struct VmaAllocationCreateInfo { VmaAllocationCreateFlags flags; VmaMemoryUsage usage; VkMemoryPropertyFlags requiredFlags; VkMemoryPropertyFlags preferredFlags; uint32_t memoryTypeBits; VmaPool pool; void * pUserData; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VmaAllocationCreateInfo.Buffer
An array ofVmaAllocationCreateInfo
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
FLAGS
MEMORYTYPEBITS
POOL
PREFERREDFLAGS
PUSERDATA
REQUIREDFLAGSThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
USAGE
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description VmaAllocationCreateInfo(java.nio.ByteBuffer container)
Creates aVmaAllocationCreateInfo
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 VmaAllocationCreateInfo
calloc()
Returns a newVmaAllocationCreateInfo
instance allocated withmemCalloc
.static VmaAllocationCreateInfo.Buffer
calloc(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated withmemCalloc
.static VmaAllocationCreateInfo
callocStack()
Returns a newVmaAllocationCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaAllocationCreateInfo.Buffer
callocStack(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaAllocationCreateInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaAllocationCreateInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaAllocationCreateInfo
create()
Returns a newVmaAllocationCreateInfo
instance allocated withBufferUtils
.static VmaAllocationCreateInfo.Buffer
create(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated withBufferUtils
.static VmaAllocationCreateInfo
create(long address)
Returns a newVmaAllocationCreateInfo
instance for the specified memory address.static VmaAllocationCreateInfo.Buffer
create(long address, int capacity)
Create aVmaAllocationCreateInfo.Buffer
instance at the specified memory.static VmaAllocationCreateInfo
createSafe(long address)
static VmaAllocationCreateInfo.Buffer
createSafe(long address, int capacity)
int
flags()
Returns the value of theflags
field.VmaAllocationCreateInfo
flags(int value)
Sets the specified value to theflags
field.static VmaAllocationCreateInfo
malloc()
Returns a newVmaAllocationCreateInfo
instance allocated withmemAlloc
.static VmaAllocationCreateInfo.Buffer
malloc(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated withmemAlloc
.static VmaAllocationCreateInfo
mallocStack()
Returns a newVmaAllocationCreateInfo
instance allocated on the thread-localMemoryStack
.static VmaAllocationCreateInfo.Buffer
mallocStack(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VmaAllocationCreateInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VmaAllocationCreateInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo
instance allocated on the specifiedMemoryStack
.int
memoryTypeBits()
Returns the value of thememoryTypeBits
field.VmaAllocationCreateInfo
memoryTypeBits(int value)
Sets the specified value to thememoryTypeBits
field.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static int
nmemoryTypeBits(long struct)
Unsafe version ofmemoryTypeBits()
.static void
nmemoryTypeBits(long struct, int value)
Unsafe version ofmemoryTypeBits
.static long
npool(long struct)
Unsafe version ofpool()
.static void
npool(long struct, long value)
Unsafe version ofpool
.static int
npreferredFlags(long struct)
Unsafe version ofpreferredFlags()
.static void
npreferredFlags(long struct, int value)
Unsafe version ofpreferredFlags
.static long
npUserData(long struct)
Unsafe version ofpUserData()
.static void
npUserData(long struct, long value)
Unsafe version ofpUserData
.static int
nrequiredFlags(long struct)
Unsafe version ofrequiredFlags()
.static void
nrequiredFlags(long struct, int value)
Unsafe version ofrequiredFlags
.static int
nusage(long struct)
Unsafe version ofusage()
.static void
nusage(long struct, int value)
Unsafe version ofusage
.long
pool()
Returns the value of thepool
field.VmaAllocationCreateInfo
pool(long value)
Sets the specified value to thepool
field.int
preferredFlags()
Returns the value of thepreferredFlags
field.VmaAllocationCreateInfo
preferredFlags(int value)
Sets the specified value to thepreferredFlags
field.long
pUserData()
Returns the value of thepUserData
field.VmaAllocationCreateInfo
pUserData(long value)
Sets the specified value to thepUserData
field.int
requiredFlags()
Returns the value of therequiredFlags
field.VmaAllocationCreateInfo
requiredFlags(int value)
Sets the specified value to therequiredFlags
field.VmaAllocationCreateInfo
set(int flags, int usage, int requiredFlags, int preferredFlags, int memoryTypeBits, long pool, long pUserData)
Initializes this struct with the specified values.VmaAllocationCreateInfo
set(VmaAllocationCreateInfo src)
Copies the specified struct data to this struct.int
sizeof()
int
usage()
Returns the value of theusage
field.VmaAllocationCreateInfo
usage(int value)
Sets the specified value to theusage
field.
-
-
-
Constructor Detail
-
VmaAllocationCreateInfo
public VmaAllocationCreateInfo(java.nio.ByteBuffer container)
Creates aVmaAllocationCreateInfo
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
-
flags
public int flags()
Returns the value of theflags
field.
-
usage
public int usage()
Returns the value of theusage
field.
-
requiredFlags
public int requiredFlags()
Returns the value of therequiredFlags
field.
-
preferredFlags
public int preferredFlags()
Returns the value of thepreferredFlags
field.
-
memoryTypeBits
public int memoryTypeBits()
Returns the value of thememoryTypeBits
field.
-
pool
public long pool()
Returns the value of thepool
field.
-
pUserData
public long pUserData()
Returns the value of thepUserData
field.
-
flags
public VmaAllocationCreateInfo flags(int value)
Sets the specified value to theflags
field.
-
usage
public VmaAllocationCreateInfo usage(int value)
Sets the specified value to theusage
field.
-
requiredFlags
public VmaAllocationCreateInfo requiredFlags(int value)
Sets the specified value to therequiredFlags
field.
-
preferredFlags
public VmaAllocationCreateInfo preferredFlags(int value)
Sets the specified value to thepreferredFlags
field.
-
memoryTypeBits
public VmaAllocationCreateInfo memoryTypeBits(int value)
Sets the specified value to thememoryTypeBits
field.
-
pool
public VmaAllocationCreateInfo pool(long value)
Sets the specified value to thepool
field.
-
pUserData
public VmaAllocationCreateInfo pUserData(long value)
Sets the specified value to thepUserData
field.
-
set
public VmaAllocationCreateInfo set(int flags, int usage, int requiredFlags, int preferredFlags, int memoryTypeBits, long pool, long pUserData)
Initializes this struct with the specified values.
-
set
public VmaAllocationCreateInfo set(VmaAllocationCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VmaAllocationCreateInfo malloc()
Returns a newVmaAllocationCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VmaAllocationCreateInfo calloc()
Returns a newVmaAllocationCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VmaAllocationCreateInfo create()
Returns a newVmaAllocationCreateInfo
instance allocated withBufferUtils
.
-
create
public static VmaAllocationCreateInfo create(long address)
Returns a newVmaAllocationCreateInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VmaAllocationCreateInfo createSafe(long address)
-
malloc
public static VmaAllocationCreateInfo.Buffer malloc(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VmaAllocationCreateInfo.Buffer calloc(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaAllocationCreateInfo.Buffer create(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaAllocationCreateInfo.Buffer create(long address, int capacity)
Create aVmaAllocationCreateInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VmaAllocationCreateInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VmaAllocationCreateInfo mallocStack()
Returns a newVmaAllocationCreateInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VmaAllocationCreateInfo callocStack()
Returns a newVmaAllocationCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VmaAllocationCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VmaAllocationCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VmaAllocationCreateInfo.Buffer mallocStack(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VmaAllocationCreateInfo.Buffer callocStack(int capacity)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VmaAllocationCreateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VmaAllocationCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocationCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
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()
.
-
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
.
-
-