Class VmaAllocatorCreateInfo
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
Layout
struct VmaAllocatorCreateInfo {
VmaAllocatorCreateFlags flags()
;
VkPhysicalDevice physicalDevice()
;
VkDevice device()
;
VkDeviceSize preferredLargeHeapBlockSize()
;
VkAllocationCallbacks
const * pAllocationCallbacks()
;
VmaDeviceMemoryCallbacks
const * pDeviceMemoryCallbacks()
;
VkDeviceSize const * pHeapSizeLimit(int)
;
VmaVulkanFunctions
const * pVulkanFunctions()
;
VkInstance instance()
;
uint32_t vulkanApiVersion()
;
VkExternalMemoryHandleTypeFlagsKHR const * pTypeExternalMemoryHandleTypes(int)
;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.static final int
The struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionVmaAllocatorCreateInfo
(ByteBuffer container) Creates aVmaAllocatorCreateInfo
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaAllocatorCreateInfo
calloc()
Returns a newVmaAllocatorCreateInfo
instance allocated withmemCalloc
.static VmaAllocatorCreateInfo
calloc
(MemoryStack stack) Returns a newVmaAllocatorCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaAllocatorCreateInfo
Deprecated.static VmaAllocatorCreateInfo
callocStack
(MemoryStack stack) Deprecated.static VmaAllocatorCreateInfo
create()
Returns a newVmaAllocatorCreateInfo
instance allocated withBufferUtils
.static VmaAllocatorCreateInfo
create
(long address) Returns a newVmaAllocatorCreateInfo
instance for the specified memory address.static VmaAllocatorCreateInfo
createSafe
(long address) long
device()
Vulkan device.Sets the specified value to thedevice()
field.int
flags()
flags for created allocator.flags
(int value) Sets the specified value to theflags()
field.long
instance()
handle to Vulkan instance object.instance
(VkInstance value) Sets the specified value to theinstance()
field.static VmaAllocatorCreateInfo
malloc()
Returns a newVmaAllocatorCreateInfo
instance allocated withmemAlloc
.static VmaAllocatorCreateInfo
malloc
(MemoryStack stack) Returns a newVmaAllocatorCreateInfo
instance allocated on the specifiedMemoryStack
.static VmaAllocatorCreateInfo
Deprecated.static VmaAllocatorCreateInfo
mallocStack
(MemoryStack stack) Deprecated.static long
ndevice
(long struct) Unsafe version ofdevice()
.static void
Unsafe version ofdevice
.static int
nflags
(long struct) Unsafe version offlags()
.static void
nflags
(long struct, int value) Unsafe version offlags
.static long
ninstance
(long struct) Unsafe version ofinstance()
.static void
ninstance
(long struct, VkInstance value) Unsafe version ofinstance
.static VkAllocationCallbacks
npAllocationCallbacks
(long struct) Unsafe version ofpAllocationCallbacks()
.static void
npAllocationCallbacks
(long struct, VkAllocationCallbacks value) Unsafe version ofpAllocationCallbacks
.static VmaDeviceMemoryCallbacks
npDeviceMemoryCallbacks
(long struct) Unsafe version ofpDeviceMemoryCallbacks()
.static void
npDeviceMemoryCallbacks
(long struct, VmaDeviceMemoryCallbacks value) Unsafe version ofpDeviceMemoryCallbacks
.static LongBuffer
npHeapSizeLimit
(long struct, int capacity) Unsafe version ofpHeapSizeLimit
.static void
npHeapSizeLimit
(long struct, LongBuffer value) Unsafe version ofpHeapSizeLimit
.static long
nphysicalDevice
(long struct) Unsafe version ofphysicalDevice()
.static void
nphysicalDevice
(long struct, VkPhysicalDevice value) Unsafe version ofphysicalDevice
.static long
npreferredLargeHeapBlockSize
(long struct) Unsafe version ofpreferredLargeHeapBlockSize()
.static void
npreferredLargeHeapBlockSize
(long struct, long value) Unsafe version ofpreferredLargeHeapBlockSize
.static IntBuffer
npTypeExternalMemoryHandleTypes
(long struct, int capacity) Unsafe version ofpTypeExternalMemoryHandleTypes
.static void
npTypeExternalMemoryHandleTypes
(long struct, IntBuffer value) Unsafe version ofpTypeExternalMemoryHandleTypes
.static VmaVulkanFunctions
npVulkanFunctions
(long struct) Unsafe version ofpVulkanFunctions()
.static void
npVulkanFunctions
(long struct, VmaVulkanFunctions value) Unsafe version ofpVulkanFunctions
.static int
nvulkanApiVersion
(long struct) Unsafe version ofvulkanApiVersion()
.static void
nvulkanApiVersion
(long struct, int value) Unsafe version ofvulkanApiVersion
.custom CPU memory allocation callbacks.Sets the address of the specifiedVkAllocationCallbacks
to thepAllocationCallbacks()
field.informative callbacks forvkAllocateMemory
,vkFreeMemory
.Sets the address of the specifiedVmaDeviceMemoryCallbacks
to thepDeviceMemoryCallbacks()
field.pHeapSizeLimit
(int capacity) pHeapSizeLimit
(LongBuffer value) Sets the address of the specifiedLongBuffer
to thepHeapSizeLimit(int)
field.long
Vulkan physical device.physicalDevice
(VkPhysicalDevice value) Sets the specified value to thephysicalDevice()
field.long
preferred size of a singleVkDeviceMemory
block to be allocated from large heaps > 1 GiB.preferredLargeHeapBlockSize
(long value) Sets the specified value to thepreferredLargeHeapBlockSize()
field.pTypeExternalMemoryHandleTypes
(int capacity) Sets the address of the specifiedIntBuffer
to thepTypeExternalMemoryHandleTypes(int)
field.pointers to Vulkan functionsSets the address of the specifiedVmaVulkanFunctions
to thepVulkanFunctions()
field.set
(int flags, VkPhysicalDevice physicalDevice, VkDevice device, long preferredLargeHeapBlockSize, VkAllocationCallbacks pAllocationCallbacks, VmaDeviceMemoryCallbacks pDeviceMemoryCallbacks, LongBuffer pHeapSizeLimit, VmaVulkanFunctions pVulkanFunctions, VkInstance instance, int vulkanApiVersion, IntBuffer pTypeExternalMemoryHandleTypes) Initializes this struct with the specified values.Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.static void
validate
(long struct) Validates pointer members that should not beNULL
.int
the highest version of Vulkan that the application is designed to use.vulkanApiVersion
(int value) Sets the specified value to thevulkanApiVersion()
field.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
FLAGS
public static final int FLAGSThe struct member offsets. -
PHYSICALDEVICE
public static final int PHYSICALDEVICEThe struct member offsets. -
DEVICE
public static final int DEVICEThe struct member offsets. -
PREFERREDLARGEHEAPBLOCKSIZE
public static final int PREFERREDLARGEHEAPBLOCKSIZEThe struct member offsets. -
PALLOCATIONCALLBACKS
public static final int PALLOCATIONCALLBACKSThe struct member offsets. -
PDEVICEMEMORYCALLBACKS
public static final int PDEVICEMEMORYCALLBACKSThe struct member offsets. -
PHEAPSIZELIMIT
public static final int PHEAPSIZELIMITThe struct member offsets. -
PVULKANFUNCTIONS
public static final int PVULKANFUNCTIONSThe struct member offsets. -
INSTANCE
public static final int INSTANCEThe struct member offsets. -
VULKANAPIVERSION
public static final int VULKANAPIVERSIONThe struct member offsets. -
PTYPEEXTERNALMEMORYHANDLETYPES
public static final int PTYPEEXTERNALMEMORYHANDLETYPESThe struct member offsets.
-
-
Constructor Details
-
VmaAllocatorCreateInfo
Creates aVmaAllocatorCreateInfo
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
.- Specified by:
sizeof
in classStruct<VmaAllocatorCreateInfo>
-
flags
public int flags()flags for created allocator. UseVmaAllocatorCreateFlagBits
enum. One of: -
physicalDevice
public long physicalDevice()Vulkan physical device. It must be valid throughout whole lifetime of created allocator. -
device
public long device()Vulkan device. It must be valid throughout whole lifetime of created allocator. -
preferredLargeHeapBlockSize
public long preferredLargeHeapBlockSize()preferred size of a singleVkDeviceMemory
block to be allocated from large heaps > 1 GiB. Set to 0 to use default, which is currently 256 MiB. Optional. -
pAllocationCallbacks
custom CPU memory allocation callbacks. Optional, can be null. When specified, will also be used for all CPU-side memory allocations. Optional. -
pDeviceMemoryCallbacks
informative callbacks forvkAllocateMemory
,vkFreeMemory
. Optional. -
pHeapSizeLimit
- Parameters:
capacity
- the number of elements in the returned buffer- Returns:
- 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 ofVkPhysicalDeviceMemoryProperties::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 usingGetMemoryProperties
.
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 usingVK_AMD_memory_overallocation_behavior
extension. - If user tries to allocate more memory from that heap using this allocator, the allocation fails with
-
pVulkanFunctions
pointers to Vulkan functions -
instance
public long instance()handle to Vulkan instance object. -
vulkanApiVersion
public int vulkanApiVersion()the highest version of Vulkan that the application is designed to use. (optional)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. It must be less or equal (preferably equal) to value as passed tovkCreateInstance
asVkApplicationInfo::apiVersion
. Only versions 1.0, 1.1, 1.2 and 1.3 are supported by the current implementation.Leaving it initialized to zero is equivalent to
VK_API_VERSION_1_0
. -
pTypeExternalMemoryHandleTypes
- Parameters:
capacity
- the number of elements in the returned buffer- Returns:
- 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 ofVkPhysicalDeviceMemoryProperties::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
.
-
flags
Sets the specified value to theflags()
field. -
physicalDevice
Sets the specified value to thephysicalDevice()
field. -
device
Sets the specified value to thedevice()
field. -
preferredLargeHeapBlockSize
Sets the specified value to thepreferredLargeHeapBlockSize()
field. -
pAllocationCallbacks
Sets the address of the specifiedVkAllocationCallbacks
to thepAllocationCallbacks()
field. -
pDeviceMemoryCallbacks
Sets the address of the specifiedVmaDeviceMemoryCallbacks
to thepDeviceMemoryCallbacks()
field. -
pHeapSizeLimit
Sets the address of the specifiedLongBuffer
to thepHeapSizeLimit(int)
field. -
pVulkanFunctions
Sets the address of the specifiedVmaVulkanFunctions
to thepVulkanFunctions()
field. -
instance
Sets the specified value to theinstance()
field. -
vulkanApiVersion
Sets the specified value to thevulkanApiVersion()
field. -
pTypeExternalMemoryHandleTypes
Sets the address of the specifiedIntBuffer
to thepTypeExternalMemoryHandleTypes(int)
field. -
set
public VmaAllocatorCreateInfo set(int flags, VkPhysicalDevice physicalDevice, VkDevice device, long preferredLargeHeapBlockSize, @Nullable VkAllocationCallbacks pAllocationCallbacks, @Nullable VmaDeviceMemoryCallbacks pDeviceMemoryCallbacks, @Nullable LongBuffer pHeapSizeLimit, VmaVulkanFunctions pVulkanFunctions, VkInstance instance, int vulkanApiVersion, @Nullable IntBuffer pTypeExternalMemoryHandleTypes) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newVmaAllocatorCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newVmaAllocatorCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newVmaAllocatorCreateInfo
instance allocated withBufferUtils
. -
create
Returns a newVmaAllocatorCreateInfo
instance for the specified memory address. -
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
malloc
Returns a newVmaAllocatorCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newVmaAllocatorCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
nflags
public static int nflags(long struct) Unsafe version offlags()
. -
nphysicalDevice
public static long nphysicalDevice(long struct) Unsafe version ofphysicalDevice()
. -
ndevice
public static long ndevice(long struct) Unsafe version ofdevice()
. -
npreferredLargeHeapBlockSize
public static long npreferredLargeHeapBlockSize(long struct) Unsafe version ofpreferredLargeHeapBlockSize()
. -
npAllocationCallbacks
Unsafe version ofpAllocationCallbacks()
. -
npDeviceMemoryCallbacks
Unsafe version ofpDeviceMemoryCallbacks()
. -
npHeapSizeLimit
Unsafe version ofpHeapSizeLimit
. -
npVulkanFunctions
Unsafe version ofpVulkanFunctions()
. -
ninstance
public static long ninstance(long struct) Unsafe version ofinstance()
. -
nvulkanApiVersion
public static int nvulkanApiVersion(long struct) Unsafe version ofvulkanApiVersion()
. -
npTypeExternalMemoryHandleTypes
Unsafe version ofpTypeExternalMemoryHandleTypes
. -
nflags
public static void nflags(long struct, int value) Unsafe version offlags
. -
nphysicalDevice
Unsafe version ofphysicalDevice
. -
ndevice
Unsafe version ofdevice
. -
npreferredLargeHeapBlockSize
public static void npreferredLargeHeapBlockSize(long struct, long value) Unsafe version ofpreferredLargeHeapBlockSize
. -
npAllocationCallbacks
Unsafe version ofpAllocationCallbacks
. -
npDeviceMemoryCallbacks
Unsafe version ofpDeviceMemoryCallbacks
. -
npHeapSizeLimit
Unsafe version ofpHeapSizeLimit
. -
npVulkanFunctions
Unsafe version ofpVulkanFunctions
. -
ninstance
Unsafe version ofinstance
. -
nvulkanApiVersion
public static void nvulkanApiVersion(long struct, int value) Unsafe version ofvulkanApiVersion
. -
npTypeExternalMemoryHandleTypes
Unsafe version ofpTypeExternalMemoryHandleTypes
. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-