Record Class VmaAllocatorCreateInfo
- All Implemented Interfaces:
IPointer
,IVmaAllocatorCreateInfo
Description of a Allocator to be created.
Structure
typedef struct VmaAllocatorCreateInfo {
VmaAllocatorCreateFlags
flags
;
VkPhysicalDevice
physicalDevice
;
VkDevice
device
;
VkDeviceSize preferredLargeHeapBlockSize
;
VkAllocationCallbacks
const* pAllocationCallbacks
; // optional
VmaDeviceMemoryCallbacks
const* pDeviceMemoryCallbacks
; // optional
VkDeviceSize const* pHeapSizeLimit
; // optional
VmaVulkanFunctions
const* pVulkanFunctions
; // optional
VkInstance
instance
;
uint32_t vulkanApiVersion
;
invalid reference
VkExternalMemoryHandleTypeFlags
KHR const* pTypeExternalMemoryHandleTypes
; // optional
void*[8] reserved;
} VmaAllocatorCreateInfo;
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()
Flags for created allocator. UseVmaAllocatorCreateFlagBits
enum.physicalDevice()
It must be valid throughout whole lifetime of created allocator.device()
It must be valid throughout whole lifetime of created allocator.preferredLargeHeapBlockSize()
Set to 0 to use default, which is currently 256 MiB.pAllocationCallbacks(club.doki7.vulkan.datatype.IVkAllocationCallbacks)
Optional, can be null. When specified, will also be used for all CPU-side memory allocations.pDeviceMemoryCallbacks(club.doki7.vma.datatype.IVmaDeviceMemoryCallbacks)
Optional, can be null.pHeapSizeLimit()
Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap.If not NULL, it must be a pointer to an array of
VkPhysicalDeviceMemoryProperties::memoryHeapCount
elements, defining limit on maximum number of bytes that can be allocated out of particular Vulkan memory heap.Any of the elements may be equal to
VK_WHOLE_SIZE
, which means no limit on that heap. This is also the default in case ofpHeapSizeLimit
= NULL.If there is a limit defined for a heap:
- If user tries to allocate more memory from that heap using this allocator,
the allocation fails with
VK_ERROR_OUT_OF_DEVICE_MEMORY
. - If the limit is smaller than heap size reported in
VkMemoryHeap::size
, the value of this limit will be reported instead when using vmaGetMemoryProperties().
Warning! Using this feature may not be equivalent to installing a GPU with smaller amount of memory, because graphics driver doesn't necessary fail new allocations with
VK_ERROR_OUT_OF_DEVICE_MEMORY
result when memory capacity is exceeded. It may return success and just silently migrate some device memory blocks to system RAM. This driver behavior can also be controlled using VK_AMD_memory_overallocation_behavior extension.- If user tries to allocate more memory from that heap using this allocator,
the allocation fails with
pVulkanFunctions(club.doki7.vma.datatype.IVmaVulkanFunctions)
Pointers to Vulkan functions. Can be null.For details see [Pointers to Vulkan functions](@ref config_Vulkan_functions).
instance()
Handle to Vulkan instance object.Starting from version 3.0.0 this member is no longer optional, it must be set!
vulkanApiVersion()
Optional. Vulkan version that the application uses.It must be a value in the format as created by macro
VK_MAKE_VERSION
or a constant like:VK_API_VERSION_1_1
,VK_API_VERSION_1_0
. The patch version number specified is ignored. Only the major and minor versions are considered. Only versions 1.0...1.4 are supported by the current implementation. Leaving it initialized to zero is equivalent toVK_API_VERSION_1_0
. It must match the Vulkan version used by the application and supported on the selected physical device, so it must be no higher thanVkApplicationInfo::apiVersion
passed tovkCreateInstance
and no higher thanVkPhysicalDeviceProperties::apiVersion
found on the physical device used.pTypeExternalMemoryHandleTypes()
Either null or a pointer to an array of external memory handle types for each Vulkan memory type.If not NULL, it must be a pointer to an array of
VkPhysicalDeviceMemoryProperties::memoryTypeCount
elements, defining external memory handle types of particular Vulkan memory type, to be passed usingVkExportMemoryAllocateInfoKHR
.Any of the elements may be equal to 0, which means not to use
VkExportMemoryAllocateInfoKHR
on this memory type. This is also the default in case ofpTypeExternalMemoryHandleTypes
= NULL.
-
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 AddressLayout
static final ValueLayout.OfInt
static final AddressLayout
static final AddressLayout
static final AddressLayout
static final AddressLayout
static final AddressLayout
static final ValueLayout.OfLong
static final AddressLayout
static final AddressLayout
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 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 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
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionVmaAllocatorCreateInfo
(@NotNull MemorySegment segment) Creates an instance of aVmaAllocatorCreateInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaAllocatorCreateInfo
static VmaAllocatorCreateInfo.Ptr
static VmaAllocatorCreateInfo
clone
(Arena arena, VmaAllocatorCreateInfo src) @Nullable VkDevice
device()
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.@Nullable VkInstance
instance()
instance
(@Nullable VkInstance value) @Nullable VkAllocationCallbacks
pAllocationCallbacks
(int assumedCount) pAllocationCallbacks
(@Nullable IVkAllocationCallbacks value) void
@Nullable VmaDeviceMemoryCallbacks
pDeviceMemoryCallbacks
(int assumedCount) pDeviceMemoryCallbacks
(@Nullable IVmaDeviceMemoryCallbacks value) void
@Nullable LongPtr
Note: the returnedLongPtr
does not have correctLongPtr.size()
property.pHeapSizeLimit
(@Nullable LongPtr value) void
pHeapSizeLimitRaw
(MemorySegment value) @Nullable VkPhysicalDevice
physicalDevice
(@Nullable VkPhysicalDevice value) long
preferredLargeHeapBlockSize
(long value) @Nullable IntPtr
Note: the returnedIntPtr
does not have correctIntPtr.size()
property.pTypeExternalMemoryHandleTypes
(@Nullable IntPtr value) void
@Nullable VmaVulkanFunctions
pVulkanFunctions
(int assumedCount) pVulkanFunctions
(@Nullable IVmaVulkanFunctions value) void
pVulkanFunctionsRaw
(MemorySegment value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.int
vulkanApiVersion
(int value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$flags
-
PATH$physicalDevice
-
PATH$device
-
PATH$preferredLargeHeapBlockSize
-
PATH$pAllocationCallbacks
-
PATH$pDeviceMemoryCallbacks
-
PATH$pHeapSizeLimit
-
PATH$pVulkanFunctions
-
PATH$instance
-
PATH$vulkanApiVersion
-
PATH$pTypeExternalMemoryHandleTypes
-
LAYOUT$flags
-
LAYOUT$physicalDevice
-
LAYOUT$device
-
LAYOUT$preferredLargeHeapBlockSize
-
LAYOUT$pAllocationCallbacks
-
LAYOUT$pDeviceMemoryCallbacks
-
LAYOUT$pHeapSizeLimit
-
LAYOUT$pVulkanFunctions
-
LAYOUT$instance
-
LAYOUT$vulkanApiVersion
-
LAYOUT$pTypeExternalMemoryHandleTypes
-
SIZE$flags
public static final long SIZE$flags -
SIZE$physicalDevice
public static final long SIZE$physicalDevice -
SIZE$device
public static final long SIZE$device -
SIZE$preferredLargeHeapBlockSize
public static final long SIZE$preferredLargeHeapBlockSize -
SIZE$pAllocationCallbacks
public static final long SIZE$pAllocationCallbacks -
SIZE$pDeviceMemoryCallbacks
public static final long SIZE$pDeviceMemoryCallbacks -
SIZE$pHeapSizeLimit
public static final long SIZE$pHeapSizeLimit -
SIZE$pVulkanFunctions
public static final long SIZE$pVulkanFunctions -
SIZE$instance
public static final long SIZE$instance -
SIZE$vulkanApiVersion
public static final long SIZE$vulkanApiVersion -
SIZE$pTypeExternalMemoryHandleTypes
public static final long SIZE$pTypeExternalMemoryHandleTypes -
OFFSET$flags
public static final long OFFSET$flags -
OFFSET$physicalDevice
public static final long OFFSET$physicalDevice -
OFFSET$device
public static final long OFFSET$device -
OFFSET$preferredLargeHeapBlockSize
public static final long OFFSET$preferredLargeHeapBlockSize -
OFFSET$pAllocationCallbacks
public static final long OFFSET$pAllocationCallbacks -
OFFSET$pDeviceMemoryCallbacks
public static final long OFFSET$pDeviceMemoryCallbacks -
OFFSET$pHeapSizeLimit
public static final long OFFSET$pHeapSizeLimit -
OFFSET$pVulkanFunctions
public static final long OFFSET$pVulkanFunctions -
OFFSET$instance
public static final long OFFSET$instance -
OFFSET$vulkanApiVersion
public static final long OFFSET$vulkanApiVersion -
OFFSET$pTypeExternalMemoryHandleTypes
public static final long OFFSET$pTypeExternalMemoryHandleTypes
-
-
Constructor Details
-
VmaAllocatorCreateInfo
Creates an instance of aVmaAllocatorCreateInfo
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
flags
-
flags
-
physicalDevice
-
physicalDevice
-
device
-
device
-
preferredLargeHeapBlockSize
-
preferredLargeHeapBlockSize
public VmaAllocatorCreateInfo preferredLargeHeapBlockSize(@NativeType("VkDeviceSize") @Unsigned long value) -
pAllocationCallbacks
public VmaAllocatorCreateInfo pAllocationCallbacks(@Nullable @Nullable IVkAllocationCallbacks value) -
pAllocationCallbacks
-
pAllocationCallbacks
-
pAllocationCallbacksRaw
-
pAllocationCallbacksRaw
public void pAllocationCallbacksRaw(@Pointer(target=VkAllocationCallbacks.class) MemorySegment value) -
pDeviceMemoryCallbacks
public VmaAllocatorCreateInfo pDeviceMemoryCallbacks(@Nullable @Nullable IVmaDeviceMemoryCallbacks value) -
pDeviceMemoryCallbacks
-
pDeviceMemoryCallbacks
-
pDeviceMemoryCallbacksRaw
-
pDeviceMemoryCallbacksRaw
public void pDeviceMemoryCallbacksRaw(@Pointer(target=VmaDeviceMemoryCallbacks.class) MemorySegment value) -
pHeapSizeLimit
Note: the returnedLongPtr
does not have correctLongPtr.size()
property. It's up to user to track the size of the buffer, and useLongPtr.reinterpret(long)
to set the size before actually reading from or writing to the buffer. -
pHeapSizeLimit
public VmaAllocatorCreateInfo pHeapSizeLimit(@Nullable @Pointer(comment="VkDeviceSize") @Unsigned @Nullable LongPtr value) -
pHeapSizeLimitRaw
-
pHeapSizeLimitRaw
-
pVulkanFunctions
-
pVulkanFunctions
-
pVulkanFunctions
-
pVulkanFunctionsRaw
-
pVulkanFunctionsRaw
-
instance
-
instance
-
vulkanApiVersion
-
vulkanApiVersion
-
pTypeExternalMemoryHandleTypes
@Nullable @EnumType(VkExternalMemoryHandleTypeFlags.class) public @Nullable IntPtr pTypeExternalMemoryHandleTypes()Note: the returnedIntPtr
does not have correctIntPtr.size()
property. It's up to user to track the size of the buffer, and useIntPtr.reinterpret(long)
to set the size before actually reading fro or writing to the buffer. -
pTypeExternalMemoryHandleTypes
public VmaAllocatorCreateInfo pTypeExternalMemoryHandleTypes(@Nullable @EnumType(VkExternalMemoryHandleTypeFlags.class) @Nullable IntPtr value) -
pTypeExternalMemoryHandleTypesRaw
@Pointer(target=VkExternalMemoryHandleTypeFlags.class) public MemorySegment pTypeExternalMemoryHandleTypesRaw() -
pTypeExternalMemoryHandleTypesRaw
public void pTypeExternalMemoryHandleTypesRaw(@Pointer(target=VkExternalMemoryHandleTypeFlags.class) MemorySegment value) -
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.
-