Class VmaAllocatorCreateInfo
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.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
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVmaAllocatorCreateInfo(ByteBuffer container) Creates aVmaAllocatorCreateInfoinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaAllocatorCreateInfocalloc()Returns a newVmaAllocatorCreateInfoinstance allocated withmemCalloc.static VmaAllocatorCreateInfocalloc(org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocatorCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VmaAllocatorCreateInfoDeprecated.static VmaAllocatorCreateInfocallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static VmaAllocatorCreateInfocreate()Returns a newVmaAllocatorCreateInfoinstance allocated withBufferUtils.static VmaAllocatorCreateInfocreate(long address) Returns a newVmaAllocatorCreateInfoinstance for the specified memory address.static @Nullable VmaAllocatorCreateInfocreateSafe(long address) longdevice()Vulkan device.device(org.lwjgl.vulkan.VkDevice value) Sets the specified value to thedevice()field.intflags()flags for created allocator.flags(int value) Sets the specified value to theflags()field.longinstance()handle to Vulkan instance object.instance(org.lwjgl.vulkan.VkInstance value) Sets the specified value to theinstance()field.static VmaAllocatorCreateInfomalloc()Returns a newVmaAllocatorCreateInfoinstance allocated withmemAlloc.static VmaAllocatorCreateInfomalloc(org.lwjgl.system.MemoryStack stack) Returns a newVmaAllocatorCreateInfoinstance allocated on the specifiedMemoryStack.static VmaAllocatorCreateInfoDeprecated.static VmaAllocatorCreateInfomallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static longndevice(long struct) Unsafe version ofdevice().static voidndevice(long struct, org.lwjgl.vulkan.VkDevice value) Unsafe version ofdevice.static intnflags(long struct) Unsafe version offlags().static voidnflags(long struct, int value) Unsafe version offlags.static longninstance(long struct) Unsafe version ofinstance().static voidninstance(long struct, org.lwjgl.vulkan.VkInstance value) Unsafe version ofinstance.static @Nullable org.lwjgl.vulkan.VkAllocationCallbacksnpAllocationCallbacks(long struct) Unsafe version ofpAllocationCallbacks().static voidnpAllocationCallbacks(long struct, @Nullable org.lwjgl.vulkan.VkAllocationCallbacks value) Unsafe version ofpAllocationCallbacks.static @Nullable VmaDeviceMemoryCallbacksnpDeviceMemoryCallbacks(long struct) Unsafe version ofpDeviceMemoryCallbacks().static voidnpDeviceMemoryCallbacks(long struct, @Nullable VmaDeviceMemoryCallbacks value) Unsafe version ofpDeviceMemoryCallbacks.static @Nullable LongBuffernpHeapSizeLimit(long struct, int capacity) Unsafe version ofpHeapSizeLimit.static voidnpHeapSizeLimit(long struct, @Nullable LongBuffer value) Unsafe version ofpHeapSizeLimit.static longnphysicalDevice(long struct) Unsafe version ofphysicalDevice().static voidnphysicalDevice(long struct, org.lwjgl.vulkan.VkPhysicalDevice value) Unsafe version ofphysicalDevice.static longnpreferredLargeHeapBlockSize(long struct) Unsafe version ofpreferredLargeHeapBlockSize().static voidnpreferredLargeHeapBlockSize(long struct, long value) Unsafe version ofpreferredLargeHeapBlockSize.static @Nullable IntBuffernpTypeExternalMemoryHandleTypes(long struct, int capacity) Unsafe version ofpTypeExternalMemoryHandleTypes.static voidnpTypeExternalMemoryHandleTypes(long struct, @Nullable IntBuffer value) Unsafe version ofpTypeExternalMemoryHandleTypes.static VmaVulkanFunctionsnpVulkanFunctions(long struct) Unsafe version ofpVulkanFunctions().static voidnpVulkanFunctions(long struct, VmaVulkanFunctions value) Unsafe version ofpVulkanFunctions.static intnvulkanApiVersion(long struct) Unsafe version ofvulkanApiVersion().static voidnvulkanApiVersion(long struct, int value) Unsafe version ofvulkanApiVersion.@Nullable org.lwjgl.vulkan.VkAllocationCallbackscustom CPU memory allocation callbacks.pAllocationCallbacks(@Nullable org.lwjgl.vulkan.VkAllocationCallbacks value) Sets the address of the specifiedVkAllocationCallbacksto thepAllocationCallbacks()field.@Nullable VmaDeviceMemoryCallbacksinformative callbacks forvkAllocateMemory,vkFreeMemory.pDeviceMemoryCallbacks(@Nullable VmaDeviceMemoryCallbacks value) Sets the address of the specifiedVmaDeviceMemoryCallbacksto thepDeviceMemoryCallbacks()field.@Nullable LongBufferpHeapSizeLimit(int capacity) pHeapSizeLimit(@Nullable LongBuffer value) Sets the address of the specifiedLongBufferto thepHeapSizeLimit(int)field.longVulkan physical device.physicalDevice(org.lwjgl.vulkan.VkPhysicalDevice value) Sets the specified value to thephysicalDevice()field.longpreferred size of a singleVkDeviceMemoryblock to be allocated from large heaps > 1 GiB.preferredLargeHeapBlockSize(long value) Sets the specified value to thepreferredLargeHeapBlockSize()field.@Nullable IntBufferpTypeExternalMemoryHandleTypes(int capacity) pTypeExternalMemoryHandleTypes(@Nullable IntBuffer value) Sets the address of the specifiedIntBufferto thepTypeExternalMemoryHandleTypes(int)field.pointers to Vulkan functionsSets the address of the specifiedVmaVulkanFunctionsto thepVulkanFunctions()field.set(int flags, org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, org.lwjgl.vulkan.VkDevice device, long preferredLargeHeapBlockSize, @Nullable org.lwjgl.vulkan.VkAllocationCallbacks pAllocationCallbacks, @Nullable VmaDeviceMemoryCallbacks pDeviceMemoryCallbacks, @Nullable LongBuffer pHeapSizeLimit, VmaVulkanFunctions pVulkanFunctions, org.lwjgl.vulkan.VkInstance instance, int vulkanApiVersion, @Nullable IntBuffer pTypeExternalMemoryHandleTypes) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct) Validates pointer members that should not beNULL.intVulkan version that the application uses.vulkanApiVersion(int value) Sets the specified value to thevulkanApiVersion()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods 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 aVmaAllocatorCreateInfoinstance at the current position of the specifiedByteBuffercontainer. 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()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VmaAllocatorCreateInfo>
-
flags
public int flags()flags for created allocator. UseVmaAllocatorCreateFlagBitsenum. 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 singleVkDeviceMemoryblock to be allocated from large heaps > 1 GiB. Set to 0 to use default, which is currently 256 MiB. Optional. -
pAllocationCallbacks
public @Nullable org.lwjgl.vulkan.VkAllocationCallbacks 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
NULLor 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::memoryHeapCountelements, 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_MEMORYresult 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_behaviorextension. - 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()Vulkan version that the application uses. (optional)It must be a value in the format as created by macro
VK_MAKE_VERSIONor 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 to
VK_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 than
VkApplicationInfo::apiVersionpassed tovkCreateInstanceand no higher thanVkPhysicalDeviceProperties::apiVersionfound on the physical device used. -
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::memoryTypeCountelements, 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
VkExportMemoryAllocateInfoKHRon 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
public VmaAllocatorCreateInfo pAllocationCallbacks(@Nullable org.lwjgl.vulkan.VkAllocationCallbacks value) Sets the address of the specifiedVkAllocationCallbacksto thepAllocationCallbacks()field. -
pDeviceMemoryCallbacks
Sets the address of the specifiedVmaDeviceMemoryCallbacksto thepDeviceMemoryCallbacks()field. -
pHeapSizeLimit
Sets the address of the specifiedLongBufferto thepHeapSizeLimit(int)field. -
pVulkanFunctions
Sets the address of the specifiedVmaVulkanFunctionsto thepVulkanFunctions()field. -
instance
Sets the specified value to theinstance()field. -
vulkanApiVersion
Sets the specified value to thevulkanApiVersion()field. -
pTypeExternalMemoryHandleTypes
Sets the address of the specifiedIntBufferto thepTypeExternalMemoryHandleTypes(int)field. -
set
public VmaAllocatorCreateInfo set(int flags, org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, org.lwjgl.vulkan.VkDevice device, long preferredLargeHeapBlockSize, @Nullable org.lwjgl.vulkan.VkAllocationCallbacks pAllocationCallbacks, @Nullable VmaDeviceMemoryCallbacks pDeviceMemoryCallbacks, @Nullable LongBuffer pHeapSizeLimit, VmaVulkanFunctions pVulkanFunctions, org.lwjgl.vulkan.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 newVmaAllocatorCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVmaAllocatorCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVmaAllocatorCreateInfoinstance allocated withBufferUtils. -
create
Returns a newVmaAllocatorCreateInfoinstance 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 newVmaAllocatorCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVmaAllocatorCreateInfoinstance allocated on the specifiedMemoryStackand 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
public static @Nullable org.lwjgl.vulkan.VkAllocationCallbacks npAllocationCallbacks(long struct) 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
public static void nphysicalDevice(long struct, org.lwjgl.vulkan.VkPhysicalDevice value) Unsafe version ofphysicalDevice. -
ndevice
public static void ndevice(long struct, org.lwjgl.vulkan.VkDevice value) Unsafe version ofdevice. -
npreferredLargeHeapBlockSize
public static void npreferredLargeHeapBlockSize(long struct, long value) Unsafe version ofpreferredLargeHeapBlockSize. -
npAllocationCallbacks
public static void npAllocationCallbacks(long struct, @Nullable org.lwjgl.vulkan.VkAllocationCallbacks value) Unsafe version ofpAllocationCallbacks. -
npDeviceMemoryCallbacks
Unsafe version ofpDeviceMemoryCallbacks. -
npHeapSizeLimit
Unsafe version ofpHeapSizeLimit. -
npVulkanFunctions
Unsafe version ofpVulkanFunctions. -
ninstance
public static void ninstance(long struct, org.lwjgl.vulkan.VkInstance value) 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
-