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_BITflag was used during creation of theVmaAllocatorobject. 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
vkGetBufferMemoryRequirementsis 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
pNextchain 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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfLongstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfLongstatic final AddressLayoutstatic final ValueLayout.OfFloatstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionVmaPoolCreateInfo(@NotNull MemorySegment segment) Creates an instance of aVmaPoolCreateInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaPoolCreateInfostatic VmaPoolCreateInfo.PtrlongblockSize(long value) static VmaPoolCreateInfoclone(Arena arena, VmaPoolCreateInfo src) final booleanIndicates whether some other object is "equal to" this one.intflags()flags(int value) final inthashCode()Returns a hash code value for this object.longmaxBlockCount(long value) intmemoryTypeIndex(int value) longminAllocationAlignment(long value) longminBlockCount(long value) @NotNull MemorySegmentpMemoryAllocateNext(@Nullable IPointer pointer) pMemoryAllocateNext(@NotNull MemorySegment value) floatpriority()priority(float value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()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 aVmaPoolCreateInforecord class.- Parameters:
segment- the value for thesegmentrecord 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
public VmaPoolCreateInfo pMemoryAllocateNext(@Pointer(comment="void*") @NotNull @NotNull MemorySegment value) -
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 thesegmentrecord component.
-