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()
UseVmaAllocationCreateFlagBits
enum.usage()
Intended usage of memory.You can leave
VMA_MEMORY_USAGE_UNKNOWN
if you specify memory requirements in other way.If
pool
is 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
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 preferred.
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.If
pool
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 as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().If
VMA_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.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_BIT
flag was used during creation of theVmaAllocator
object 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 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.OfInt
static final ValueLayout.OfInt
static final AddressLayout
static final ValueLayout.OfInt
static final ValueLayout.OfFloat
static final AddressLayout
static final ValueLayout.OfInt
static final ValueLayout.OfInt
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
ConstructorsConstructorDescriptionVmaAllocationCreateInfo
(@NotNull MemorySegment segment) Creates an instance of aVmaAllocationCreateInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaAllocationCreateInfo
static VmaAllocationCreateInfo.Ptr
static VmaAllocationCreateInfo
clone
(Arena arena, VmaAllocationCreateInfo 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.int
memoryTypeBits
(int value) @Nullable VmaPool
pool()
int
preferredFlags
(int value) float
priority()
priority
(float value) void
pUserData
(MemorySegment value) int
requiredFlags
(int value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.int
usage()
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 aVmaAllocationCreateInfo
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
flags
-
flags
-
usage
-
usage
-
requiredFlags
-
requiredFlags
-
preferredFlags
-
preferredFlags
-
memoryTypeBits
-
memoryTypeBits
-
pool
-
pool
-
pUserData
-
pUserData
-
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 thesegment
record component.
-