Class VmaPoolCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.vma.VmaPoolCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VmaPoolCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Describes parameter of createdVmaPool
.Member documentation
memoryTypeIndex
– Vulkan memory type index to allocate this pool fromflags
– Use combination ofVmaPoolCreateFlagBits
. One or more of:POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT
POOL_CREATE_LINEAR_ALGORITHM_BIT
POOL_CREATE_BUDDY_ALGORITHM_BIT
POOL_CREATE_ALGORITHM_MASK
blockSize
– size of a singleVkDeviceMemory
block to be allocated as part of this pool, in bytes. Optional.Specify nonzero to set explicit, constant size of memory blocks used by this pool. Leave 0 to use default and let the library manage block sizes automatically. Sizes of particular blocks may vary.
minBlockCount
– minimum number of blocks to be always allocated in this pool, even if they stay empty.Set to 0 to have no preallocated blocks and allow the pool be completely empty.
maxBlockCount
– maximum number of blocks that can be allocated in this pool. Optional.Set to 0 to use default, which is
SIZE_MAX
, which means no limit. Set to same value asVmaPoolCreateInfo
::minBlockCount
to have fixed amount of memory allocated throughout whole lifetime of this pool.frameInUseCount
– maximum number of additional frames that are in use at the same time as current frame.This value is used only when you make allocations with
ALLOCATION_CREATE_CAN_BECOME_LOST_BIT
flag. Such allocation cannot become lost ifallocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount
.For example, if you double-buffer your command buffers, so resources used for rendering in previous frame may still be in use by the GPU at the moment you allocate resources needed for the current frame, set this value to 1.
If you want to allow any allocations other than used in the current frame to become lost, set this value to 0.
Layout
struct VmaPoolCreateInfo { uint32_t memoryTypeIndex; VmaPoolCreateFlags flags; VkDeviceSize blockSize; size_t minBlockCount; size_t maxBlockCount; uint32_t frameInUseCount; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VmaPoolCreateInfo.Buffer
An array ofVmaPoolCreateInfo
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
BLOCKSIZE
FLAGS
FRAMEINUSECOUNT
MAXBLOCKCOUNT
MEMORYTYPEINDEX
MINBLOCKCOUNTThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VmaPoolCreateInfo(java.nio.ByteBuffer container)
Creates aVmaPoolCreateInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
blockSize()
Returns the value of theblockSize
field.VmaPoolCreateInfo
blockSize(long value)
Sets the specified value to theblockSize
field.static VmaPoolCreateInfo
calloc()
Returns a newVmaPoolCreateInfo
instance allocated withmemCalloc
.static VmaPoolCreateInfo.Buffer
calloc(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated withmemCalloc
.static VmaPoolCreateInfo
callocStack()
Returns a newVmaPoolCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaPoolCreateInfo.Buffer
callocStack(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaPoolCreateInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaPoolCreateInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaPoolCreateInfo
create()
Returns a newVmaPoolCreateInfo
instance allocated withBufferUtils
.static VmaPoolCreateInfo.Buffer
create(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated withBufferUtils
.static VmaPoolCreateInfo
create(long address)
Returns a newVmaPoolCreateInfo
instance for the specified memory address.static VmaPoolCreateInfo.Buffer
create(long address, int capacity)
Create aVmaPoolCreateInfo.Buffer
instance at the specified memory.static VmaPoolCreateInfo
createSafe(long address)
static VmaPoolCreateInfo.Buffer
createSafe(long address, int capacity)
int
flags()
Returns the value of theflags
field.VmaPoolCreateInfo
flags(int value)
Sets the specified value to theflags
field.int
frameInUseCount()
Returns the value of theframeInUseCount
field.VmaPoolCreateInfo
frameInUseCount(int value)
Sets the specified value to theframeInUseCount
field.static VmaPoolCreateInfo
malloc()
Returns a newVmaPoolCreateInfo
instance allocated withmemAlloc
.static VmaPoolCreateInfo.Buffer
malloc(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated withmemAlloc
.static VmaPoolCreateInfo
mallocStack()
Returns a newVmaPoolCreateInfo
instance allocated on the thread-localMemoryStack
.static VmaPoolCreateInfo.Buffer
mallocStack(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VmaPoolCreateInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VmaPoolCreateInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo
instance allocated on the specifiedMemoryStack
.long
maxBlockCount()
Returns the value of themaxBlockCount
field.VmaPoolCreateInfo
maxBlockCount(long value)
Sets the specified value to themaxBlockCount
field.int
memoryTypeIndex()
Returns the value of thememoryTypeIndex
field.VmaPoolCreateInfo
memoryTypeIndex(int value)
Sets the specified value to thememoryTypeIndex
field.long
minBlockCount()
Returns the value of theminBlockCount
field.VmaPoolCreateInfo
minBlockCount(long value)
Sets the specified value to theminBlockCount
field.static long
nblockSize(long struct)
Unsafe version ofblockSize()
.static void
nblockSize(long struct, long value)
Unsafe version ofblockSize
.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static int
nframeInUseCount(long struct)
Unsafe version offrameInUseCount()
.static void
nframeInUseCount(long struct, int value)
Unsafe version offrameInUseCount
.static long
nmaxBlockCount(long struct)
Unsafe version ofmaxBlockCount()
.static void
nmaxBlockCount(long struct, long value)
Unsafe version ofmaxBlockCount
.static int
nmemoryTypeIndex(long struct)
Unsafe version ofmemoryTypeIndex()
.static void
nmemoryTypeIndex(long struct, int value)
Unsafe version ofmemoryTypeIndex
.static long
nminBlockCount(long struct)
Unsafe version ofminBlockCount()
.static void
nminBlockCount(long struct, long value)
Unsafe version ofminBlockCount
.VmaPoolCreateInfo
set(int memoryTypeIndex, int flags, long blockSize, long minBlockCount, long maxBlockCount, int frameInUseCount)
Initializes this struct with the specified values.VmaPoolCreateInfo
set(VmaPoolCreateInfo src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
VmaPoolCreateInfo
public VmaPoolCreateInfo(java.nio.ByteBuffer container)
Creates aVmaPoolCreateInfo
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
-
memoryTypeIndex
public int memoryTypeIndex()
Returns the value of thememoryTypeIndex
field.
-
flags
public int flags()
Returns the value of theflags
field.
-
blockSize
public long blockSize()
Returns the value of theblockSize
field.
-
minBlockCount
public long minBlockCount()
Returns the value of theminBlockCount
field.
-
maxBlockCount
public long maxBlockCount()
Returns the value of themaxBlockCount
field.
-
frameInUseCount
public int frameInUseCount()
Returns the value of theframeInUseCount
field.
-
memoryTypeIndex
public VmaPoolCreateInfo memoryTypeIndex(int value)
Sets the specified value to thememoryTypeIndex
field.
-
flags
public VmaPoolCreateInfo flags(int value)
Sets the specified value to theflags
field.
-
blockSize
public VmaPoolCreateInfo blockSize(long value)
Sets the specified value to theblockSize
field.
-
minBlockCount
public VmaPoolCreateInfo minBlockCount(long value)
Sets the specified value to theminBlockCount
field.
-
maxBlockCount
public VmaPoolCreateInfo maxBlockCount(long value)
Sets the specified value to themaxBlockCount
field.
-
frameInUseCount
public VmaPoolCreateInfo frameInUseCount(int value)
Sets the specified value to theframeInUseCount
field.
-
set
public VmaPoolCreateInfo set(int memoryTypeIndex, int flags, long blockSize, long minBlockCount, long maxBlockCount, int frameInUseCount)
Initializes this struct with the specified values.
-
set
public VmaPoolCreateInfo set(VmaPoolCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VmaPoolCreateInfo malloc()
Returns a newVmaPoolCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VmaPoolCreateInfo calloc()
Returns a newVmaPoolCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VmaPoolCreateInfo create()
Returns a newVmaPoolCreateInfo
instance allocated withBufferUtils
.
-
create
public static VmaPoolCreateInfo create(long address)
Returns a newVmaPoolCreateInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VmaPoolCreateInfo createSafe(long address)
-
malloc
public static VmaPoolCreateInfo.Buffer malloc(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VmaPoolCreateInfo.Buffer calloc(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaPoolCreateInfo.Buffer create(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaPoolCreateInfo.Buffer create(long address, int capacity)
Create aVmaPoolCreateInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VmaPoolCreateInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VmaPoolCreateInfo mallocStack()
Returns a newVmaPoolCreateInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VmaPoolCreateInfo callocStack()
Returns a newVmaPoolCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VmaPoolCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VmaPoolCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VmaPoolCreateInfo.Buffer mallocStack(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VmaPoolCreateInfo.Buffer callocStack(int capacity)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VmaPoolCreateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VmaPoolCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaPoolCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nmemoryTypeIndex
public static int nmemoryTypeIndex(long struct)
Unsafe version ofmemoryTypeIndex()
.
-
nflags
public static int nflags(long struct)
Unsafe version offlags()
.
-
nblockSize
public static long nblockSize(long struct)
Unsafe version ofblockSize()
.
-
nminBlockCount
public static long nminBlockCount(long struct)
Unsafe version ofminBlockCount()
.
-
nmaxBlockCount
public static long nmaxBlockCount(long struct)
Unsafe version ofmaxBlockCount()
.
-
nframeInUseCount
public static int nframeInUseCount(long struct)
Unsafe version offrameInUseCount()
.
-
nmemoryTypeIndex
public static void nmemoryTypeIndex(long struct, int value)
Unsafe version ofmemoryTypeIndex
.
-
nflags
public static void nflags(long struct, int value)
Unsafe version offlags
.
-
nblockSize
public static void nblockSize(long struct, long value)
Unsafe version ofblockSize
.
-
nminBlockCount
public static void nminBlockCount(long struct, long value)
Unsafe version ofminBlockCount
.
-
nmaxBlockCount
public static void nmaxBlockCount(long struct, long value)
Unsafe version ofmaxBlockCount
.
-
nframeInUseCount
public static void nframeInUseCount(long struct, int value)
Unsafe version offrameInUseCount
.
-
-