Class VmaAllocatorCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.vma.VmaAllocatorCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VmaAllocatorCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceDescription of an Allocator to be created.Layout
struct VmaAllocatorCreateInfo { VmaAllocatorCreateFlagsflags(); VkPhysicalDevicephysicalDevice(); VkDevicedevice(); VkDeviceSizepreferredLargeHeapBlockSize();VkAllocationCallbacksconst *pAllocationCallbacks();VmaDeviceMemoryCallbacksconst *pDeviceMemoryCallbacks(); VkDeviceSize const *pHeapSizeLimit(int);VmaVulkanFunctionsconst *pVulkanFunctions(); VkInstanceinstance(); uint32_tvulkanApiVersion(); VkExternalMemoryHandleTypeFlagsKHR const *pTypeExternalMemoryHandleTypes(int); }
-
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intDEVICE
FLAGS
INSTANCE
PALLOCATIONCALLBACKS
PDEVICEMEMORYCALLBACKS
PHEAPSIZELIMIT
PHYSICALDEVICE
PREFERREDLARGEHEAPBLOCKSIZE
PTYPEEXTERNALMEMORYHANDLETYPES
PVULKANFUNCTIONSThe struct member offsets.static intSIZEOFThe struct size in bytes.static intVULKANAPIVERSIONThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VmaAllocatorCreateInfo(java.nio.ByteBuffer container)Creates aVmaAllocatorCreateInfoinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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 VmaAllocatorCreateInfocallocStack()Deprecated.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 VmaAllocatorCreateInfocreateSafe(long address)longdevice()Vulkan device.VmaAllocatorCreateInfodevice(org.lwjgl.vulkan.VkDevice value)Sets the specified value to thedevice()field.intflags()flags for created allocator.VmaAllocatorCreateInfoflags(int value)Sets the specified value to theflags()field.longinstance()handle to Vulkan instance object.VmaAllocatorCreateInfoinstance(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 VmaAllocatorCreateInfomallocStack()Deprecated.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 org.lwjgl.vulkan.VkAllocationCallbacksnpAllocationCallbacks(long struct)Unsafe version ofpAllocationCallbacks().static voidnpAllocationCallbacks(long struct, org.lwjgl.vulkan.VkAllocationCallbacks value)Unsafe version ofpAllocationCallbacks.static VmaDeviceMemoryCallbacksnpDeviceMemoryCallbacks(long struct)Unsafe version ofpDeviceMemoryCallbacks().static voidnpDeviceMemoryCallbacks(long struct, VmaDeviceMemoryCallbacks value)Unsafe version ofpDeviceMemoryCallbacks.static java.nio.LongBuffernpHeapSizeLimit(long struct, int capacity)Unsafe version ofpHeapSizeLimit.static voidnpHeapSizeLimit(long struct, java.nio.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 java.nio.IntBuffernpTypeExternalMemoryHandleTypes(long struct, int capacity)Unsafe version ofpTypeExternalMemoryHandleTypes.static voidnpTypeExternalMemoryHandleTypes(long struct, java.nio.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.org.lwjgl.vulkan.VkAllocationCallbackspAllocationCallbacks()custom CPU memory allocation callbacks.VmaAllocatorCreateInfopAllocationCallbacks(org.lwjgl.vulkan.VkAllocationCallbacks value)Sets the address of the specifiedVkAllocationCallbacksto thepAllocationCallbacks()field.VmaDeviceMemoryCallbackspDeviceMemoryCallbacks()informative callbacks forvkAllocateMemory,vkFreeMemory.VmaAllocatorCreateInfopDeviceMemoryCallbacks(VmaDeviceMemoryCallbacks value)Sets the address of the specifiedVmaDeviceMemoryCallbacksto thepDeviceMemoryCallbacks()field.java.nio.LongBufferpHeapSizeLimit(int capacity)VmaAllocatorCreateInfopHeapSizeLimit(java.nio.LongBuffer value)Sets the address of the specifiedLongBufferto thepHeapSizeLimit(int)field.longphysicalDevice()Vulkan physical device.VmaAllocatorCreateInfophysicalDevice(org.lwjgl.vulkan.VkPhysicalDevice value)Sets the specified value to thephysicalDevice()field.longpreferredLargeHeapBlockSize()preferred size of a singleVkDeviceMemoryblock to be allocated from large heaps > 1 GiB.VmaAllocatorCreateInfopreferredLargeHeapBlockSize(long value)Sets the specified value to thepreferredLargeHeapBlockSize()field.java.nio.IntBufferpTypeExternalMemoryHandleTypes(int capacity)VmaAllocatorCreateInfopTypeExternalMemoryHandleTypes(java.nio.IntBuffer value)Sets the address of the specifiedIntBufferto thepTypeExternalMemoryHandleTypes(int)field.VmaVulkanFunctionspVulkanFunctions()pointers to Vulkan functionsVmaAllocatorCreateInfopVulkanFunctions(VmaVulkanFunctions value)Sets the address of the specifiedVmaVulkanFunctionsto thepVulkanFunctions()field.VmaAllocatorCreateInfoset(int flags, org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, org.lwjgl.vulkan.VkDevice device, long preferredLargeHeapBlockSize, org.lwjgl.vulkan.VkAllocationCallbacks pAllocationCallbacks, VmaDeviceMemoryCallbacks pDeviceMemoryCallbacks, java.nio.LongBuffer pHeapSizeLimit, VmaVulkanFunctions pVulkanFunctions, org.lwjgl.vulkan.VkInstance instance, int vulkanApiVersion, java.nio.IntBuffer pTypeExternalMemoryHandleTypes)Initializes this struct with the specified values.VmaAllocatorCreateInfoset(VmaAllocatorCreateInfo src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.intvulkanApiVersion()the highest version of Vulkan that the application is designed to use.VmaAllocatorCreateInfovulkanApiVersion(int value)Sets the specified value to thevulkanApiVersion()field.
-
-
-
Field Detail
-
SIZEOF
The struct size in bytes.
-
ALIGNOF
The struct alignment in bytes.
-
FLAGS, PHYSICALDEVICE, DEVICE, PREFERREDLARGEHEAPBLOCKSIZE, PALLOCATIONCALLBACKS, PDEVICEMEMORYCALLBACKS, PHEAPSIZELIMIT, PVULKANFUNCTIONS, INSTANCE, VULKANAPIVERSION, PTYPEEXTERNALMEMORYHANDLETYPES
The struct member offsets.
-
-
Constructor Detail
-
VmaAllocatorCreateInfo
public VmaAllocatorCreateInfo(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
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
@Nullable public 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
@Nullable public VmaDeviceMemoryCallbacks pDeviceMemoryCallbacks()
informative callbacks forvkAllocateMemory,vkFreeMemory. Optional.
-
pHeapSizeLimit
@Nullable public java.nio.LongBuffer pHeapSizeLimit(int capacity)
- 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
public VmaVulkanFunctions 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_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. It must be less or equal (preferably equal) to value as passed tovkCreateInstanceasVkApplicationInfo::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
@Nullable public java.nio.IntBuffer pTypeExternalMemoryHandleTypes(int capacity)
- 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
public VmaAllocatorCreateInfo flags(int value)
Sets the specified value to theflags()field.
-
physicalDevice
public VmaAllocatorCreateInfo physicalDevice(org.lwjgl.vulkan.VkPhysicalDevice value)
Sets the specified value to thephysicalDevice()field.
-
device
public VmaAllocatorCreateInfo device(org.lwjgl.vulkan.VkDevice value)
Sets the specified value to thedevice()field.
-
preferredLargeHeapBlockSize
public VmaAllocatorCreateInfo preferredLargeHeapBlockSize(long value)
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
public VmaAllocatorCreateInfo pDeviceMemoryCallbacks(@Nullable VmaDeviceMemoryCallbacks value)
Sets the address of the specifiedVmaDeviceMemoryCallbacksto thepDeviceMemoryCallbacks()field.
-
pHeapSizeLimit
public VmaAllocatorCreateInfo pHeapSizeLimit(@Nullable java.nio.LongBuffer value)
Sets the address of the specifiedLongBufferto thepHeapSizeLimit(int)field.
-
pVulkanFunctions
public VmaAllocatorCreateInfo pVulkanFunctions(VmaVulkanFunctions value)
Sets the address of the specifiedVmaVulkanFunctionsto thepVulkanFunctions()field.
-
instance
public VmaAllocatorCreateInfo instance(org.lwjgl.vulkan.VkInstance value)
Sets the specified value to theinstance()field.
-
vulkanApiVersion
public VmaAllocatorCreateInfo vulkanApiVersion(int value)
Sets the specified value to thevulkanApiVersion()field.
-
pTypeExternalMemoryHandleTypes
public VmaAllocatorCreateInfo pTypeExternalMemoryHandleTypes(@Nullable java.nio.IntBuffer value)
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 java.nio.LongBuffer pHeapSizeLimit, VmaVulkanFunctions pVulkanFunctions, org.lwjgl.vulkan.VkInstance instance, int vulkanApiVersion, @Nullable java.nio.IntBuffer pTypeExternalMemoryHandleTypes)
Initializes this struct with the specified values.
-
set
public VmaAllocatorCreateInfo set(VmaAllocatorCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VmaAllocatorCreateInfo malloc()
Returns a newVmaAllocatorCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VmaAllocatorCreateInfo calloc()
Returns a newVmaAllocatorCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VmaAllocatorCreateInfo create()
Returns a newVmaAllocatorCreateInfoinstance allocated withBufferUtils.
-
create
public static VmaAllocatorCreateInfo create(long address)
Returns a newVmaAllocatorCreateInfoinstance for the specified memory address.
-
createSafe
@Nullable public static VmaAllocatorCreateInfo createSafe(long address)
-
mallocStack
@Deprecated public static VmaAllocatorCreateInfo mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VmaAllocatorCreateInfo callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VmaAllocatorCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VmaAllocatorCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
malloc
public static VmaAllocatorCreateInfo malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVmaAllocatorCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VmaAllocatorCreateInfo calloc(org.lwjgl.system.MemoryStack stack)
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
@Nullable public static org.lwjgl.vulkan.VkAllocationCallbacks npAllocationCallbacks(long struct)
Unsafe version ofpAllocationCallbacks().
-
npDeviceMemoryCallbacks
@Nullable public static VmaDeviceMemoryCallbacks npDeviceMemoryCallbacks(long struct)
Unsafe version ofpDeviceMemoryCallbacks().
-
npHeapSizeLimit
@Nullable public static java.nio.LongBuffer npHeapSizeLimit(long struct, int capacity)Unsafe version ofpHeapSizeLimit.
-
npVulkanFunctions
public static VmaVulkanFunctions npVulkanFunctions(long struct)
Unsafe version ofpVulkanFunctions().
-
ninstance
public static long ninstance(long struct)
Unsafe version ofinstance().
-
nvulkanApiVersion
public static int nvulkanApiVersion(long struct)
Unsafe version ofvulkanApiVersion().
-
npTypeExternalMemoryHandleTypes
@Nullable public static java.nio.IntBuffer npTypeExternalMemoryHandleTypes(long struct, int capacity)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
public static void npDeviceMemoryCallbacks(long struct, @Nullable VmaDeviceMemoryCallbacks value)Unsafe version ofpDeviceMemoryCallbacks.
-
npHeapSizeLimit
public static void npHeapSizeLimit(long struct, @Nullable java.nio.LongBuffer value)Unsafe version ofpHeapSizeLimit.
-
npVulkanFunctions
public static void npVulkanFunctions(long struct, VmaVulkanFunctions value)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
public static void npTypeExternalMemoryHandleTypes(long struct, @Nullable java.nio.IntBuffer value)Unsafe version ofpTypeExternalMemoryHandleTypes.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-