Record Class VmaPoolCreateInfo
- All Implemented Interfaces:
IPointer
,IVmaPoolCreateInfo
Describes parameter of created VmaPool
.
Structure
typedef struct VmaPoolCreateInfo {
uint32_t memoryTypeIndex
;
VmaPoolCreateFlags
flags
;
VkDeviceSize blockSize
;
size_t minBlockCount
;
size_t maxBlockCount
;
float priority
;
VkDeviceSize minAllocationAlignment
;
void* pMemoryAllocateNext
; // optional
} VmaPoolCreateInfo;
Contracts
The property segment()
should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)
), and properly aligned to
LAYOUT.byteAlignment()
bytes. To represent null pointer, you may use a Java
null
instead. See the documentation of IPointer.segment()
for more details.
The constructor of this class is marked as UnsafeConstructor
, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
Member documentation
memoryTypeIndex()
Vulkan memory type index to allocate this pool from.flags()
Use combination ofVmaPoolCreateFlagBits
.blockSize()
Size of a single `VkDeviceMemory` 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. In this case, the pool will also support dedicated allocations.
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 as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated throughout whole lifetime of this pool.
priority()
A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations.It is used only when
VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT
flag was used during creation of theVmaAllocator
object. Otherwise, this variable is ignored.minAllocationAlignment()
Additional minimum alignment to be used for all allocations created from this pool. Can be 0.Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two. It can be useful in cases where alignment returned by Vulkan by functions like
vkGetBufferMemoryRequirements
is not enough, e.g. when doing interop with OpenGL.pMemoryAllocateNext()
Additional `pNext` chain to be attached to `VkMemoryAllocateInfo` used for every allocation made by this pool. Optional.Optional, can be null. If not null, it must point to a
pNext
chain of structures that can be attached toVkMemoryAllocateInfo
. It can be useful for special needs such as addingVkExportMemoryAllocateInfoKHR
. Structures pointed by this member must remain alive and unchanged for the whole lifetime of the custom pool.Please note that some structures, e.g.
VkMemoryPriorityAllocateInfoEXT
,VkMemoryDedicatedAllocateInfoKHR
, can be attached automatically by this library when using other, more convenient of its features.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfLong
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfLong
static final AddressLayout
static final ValueLayout.OfFloat
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionVmaPoolCreateInfo
(@NotNull MemorySegment segment) Creates an instance of aVmaPoolCreateInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaPoolCreateInfo
static VmaPoolCreateInfo.Ptr
long
blockSize
(long value) static VmaPoolCreateInfo
clone
(Arena arena, VmaPoolCreateInfo src) final boolean
Indicates whether some other object is "equal to" this one.int
flags()
flags
(int value) final int
hashCode()
Returns a hash code value for this object.long
maxBlockCount
(long value) int
memoryTypeIndex
(int value) long
minAllocationAlignment
(long value) long
minBlockCount
(long value) pMemoryAllocateNext
(@Nullable IPointer pointer) void
pMemoryAllocateNext
(MemorySegment value) float
priority()
priority
(float value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$memoryTypeIndex
-
PATH$flags
-
PATH$blockSize
-
PATH$minBlockCount
-
PATH$maxBlockCount
-
PATH$priority
-
PATH$minAllocationAlignment
-
PATH$pMemoryAllocateNext
-
LAYOUT$memoryTypeIndex
-
LAYOUT$flags
-
LAYOUT$blockSize
-
LAYOUT$priority
-
LAYOUT$minAllocationAlignment
-
LAYOUT$pMemoryAllocateNext
-
SIZE$memoryTypeIndex
public static final long SIZE$memoryTypeIndex -
SIZE$flags
public static final long SIZE$flags -
SIZE$blockSize
public static final long SIZE$blockSize -
SIZE$minBlockCount
public static final long SIZE$minBlockCount -
SIZE$maxBlockCount
public static final long SIZE$maxBlockCount -
SIZE$priority
public static final long SIZE$priority -
SIZE$minAllocationAlignment
public static final long SIZE$minAllocationAlignment -
SIZE$pMemoryAllocateNext
public static final long SIZE$pMemoryAllocateNext -
OFFSET$memoryTypeIndex
public static final long OFFSET$memoryTypeIndex -
OFFSET$flags
public static final long OFFSET$flags -
OFFSET$blockSize
public static final long OFFSET$blockSize -
OFFSET$minBlockCount
public static final long OFFSET$minBlockCount -
OFFSET$maxBlockCount
public static final long OFFSET$maxBlockCount -
OFFSET$priority
public static final long OFFSET$priority -
OFFSET$minAllocationAlignment
public static final long OFFSET$minAllocationAlignment -
OFFSET$pMemoryAllocateNext
public static final long OFFSET$pMemoryAllocateNext
-
-
Constructor Details
-
VmaPoolCreateInfo
Creates an instance of aVmaPoolCreateInfo
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
memoryTypeIndex
-
memoryTypeIndex
-
flags
-
flags
-
blockSize
-
blockSize
-
minBlockCount
-
minBlockCount
-
maxBlockCount
-
maxBlockCount
-
priority
public float priority() -
priority
-
minAllocationAlignment
-
minAllocationAlignment
-
pMemoryAllocateNext
-
pMemoryAllocateNext
-
pMemoryAllocateNext
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-