Record Class VmaAllocationCreateInfo
- All Implemented Interfaces:
IPointer,IVmaAllocationCreateInfo
Parameters of new VmaAllocation.
To be used with functions like vmaCreateBuffer(), vmaCreateImage(), and many others.
Structure
typedef struct VmaAllocationCreateInfo {
VmaAllocationCreateFlags flags;
VmaMemoryUsage usage;
VkMemoryPropertyFlags requiredFlags;
VkMemoryPropertyFlags preferredFlags;
uint32_t memoryTypeBits;
VmaPool pool; // optional
void* pUserData; // optional
float priority;
} VmaAllocationCreateInfo;
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
flags()UseVmaAllocationCreateFlagBitsenum.usage()Intended usage of memory.You can leave
VMA_MEMORY_USAGE_UNKNOWNif you specify memory requirements in other way.If
poolis not null, this member is ignored.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()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()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.If
poolis not null, this member is ignored.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()Custom general-purpose pointer that will be stored inVmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().If
VMA_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()A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.It is used only when
VMA_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 usingVMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Otherwise, it has the priority of a memory block where it is placed and this variable is ignored.
-
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.OfIntstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfFloatstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic 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
ConstructorsConstructorDescriptionVmaAllocationCreateInfo(@NotNull MemorySegment segment) Creates an instance of aVmaAllocationCreateInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaAllocationCreateInfostatic VmaAllocationCreateInfo.Ptrstatic VmaAllocationCreateInfoclone(Arena arena, VmaAllocationCreateInfo 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.intmemoryTypeBits(int value) @Nullable VmaPoolpool()intpreferredFlags(int value) floatpriority()priority(float value) @NotNull MemorySegmentpUserData(@NotNull MemorySegment value) intrequiredFlags(int value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()Returns a string representation of this record class.intusage()usage(int value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$flags
-
PATH$usage
-
PATH$requiredFlags
-
PATH$preferredFlags
-
PATH$memoryTypeBits
-
PATH$pool
-
PATH$pUserData
-
PATH$priority
-
LAYOUT$flags
-
LAYOUT$usage
-
LAYOUT$requiredFlags
-
LAYOUT$preferredFlags
-
LAYOUT$memoryTypeBits
-
LAYOUT$pool
-
LAYOUT$pUserData
-
LAYOUT$priority
-
SIZE$flags
public static final long SIZE$flags -
SIZE$usage
public static final long SIZE$usage -
SIZE$requiredFlags
public static final long SIZE$requiredFlags -
SIZE$preferredFlags
public static final long SIZE$preferredFlags -
SIZE$memoryTypeBits
public static final long SIZE$memoryTypeBits -
SIZE$pool
public static final long SIZE$pool -
SIZE$pUserData
public static final long SIZE$pUserData -
SIZE$priority
public static final long SIZE$priority -
OFFSET$flags
public static final long OFFSET$flags -
OFFSET$usage
public static final long OFFSET$usage -
OFFSET$requiredFlags
public static final long OFFSET$requiredFlags -
OFFSET$preferredFlags
public static final long OFFSET$preferredFlags -
OFFSET$memoryTypeBits
public static final long OFFSET$memoryTypeBits -
OFFSET$pool
public static final long OFFSET$pool -
OFFSET$pUserData
public static final long OFFSET$pUserData -
OFFSET$priority
public static final long OFFSET$priority
-
-
Constructor Details
-
VmaAllocationCreateInfo
Creates an instance of aVmaAllocationCreateInforecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
flags
-
flags
-
usage
-
usage
-
requiredFlags
-
requiredFlags
-
preferredFlags
-
preferredFlags
-
memoryTypeBits
-
memoryTypeBits
-
pool
-
pool
-
pUserData
-
pUserData
public VmaAllocationCreateInfo pUserData(@Pointer(comment="void*") @NotNull @NotNull MemorySegment value) -
pUserData
-
priority
public float priority() -
priority
-
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.
-