Class VmaAllocatorCreateInfo

    • 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 a VmaAllocatorCreateInfo instance at the current position of the specified ByteBuffer 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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • 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 single VkDeviceMemory block 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 for vkAllocateMemory, vkFreeMemory. Optional.
      • pHeapSizeLimit

        @Nullable
        public java.nio.LongBuffer pHeapSizeLimit​(int capacity)
        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 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 of pHeapSizeLimit = 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 GetMemoryProperties.

        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.

      • 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_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 to vkCreateInstance as VkApplicationInfo::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 of VkPhysicalDeviceMemoryProperties::memoryTypeCount elements, defining external memory handle types of particular Vulkan memory type, to be passed using VkExportMemoryAllocateInfoKHR.

        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 of pTypeExternalMemoryHandleTypes = NULL.

      • pAllocationCallbacks

        public VmaAllocatorCreateInfo pAllocationCallbacks​(@Nullable
                                                           org.lwjgl.vulkan.VkAllocationCallbacks value)
        Sets the address of the specified VkAllocationCallbacks to the pAllocationCallbacks() 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.
      • malloc

        public static VmaAllocatorCreateInfo malloc()
        Returns a new VmaAllocatorCreateInfo instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VmaAllocatorCreateInfo calloc()
        Returns a new VmaAllocatorCreateInfo instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VmaAllocatorCreateInfo create()
        Returns a new VmaAllocatorCreateInfo instance allocated with BufferUtils.
      • create

        public static VmaAllocatorCreateInfo create​(long address)
        Returns a new VmaAllocatorCreateInfo instance for the specified memory address.
      • createSafe

        @Nullable
        public static VmaAllocatorCreateInfo createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static VmaAllocatorCreateInfo malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VmaAllocatorCreateInfo instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static VmaAllocatorCreateInfo calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VmaAllocatorCreateInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nflags

        public static int nflags​(long struct)
        Unsafe version of flags().
      • nphysicalDevice

        public static long nphysicalDevice​(long struct)
        Unsafe version of physicalDevice().
      • ndevice

        public static long ndevice​(long struct)
        Unsafe version of device().
      • npreferredLargeHeapBlockSize

        public static long npreferredLargeHeapBlockSize​(long struct)
      • npAllocationCallbacks

        @Nullable
        public static org.lwjgl.vulkan.VkAllocationCallbacks npAllocationCallbacks​(long struct)
        Unsafe version of pAllocationCallbacks().
      • npHeapSizeLimit

        @Nullable
        public static java.nio.LongBuffer npHeapSizeLimit​(long struct,
                                                          int capacity)
        Unsafe version of pHeapSizeLimit.
      • ninstance

        public static long ninstance​(long struct)
        Unsafe version of instance().
      • nvulkanApiVersion

        public static int nvulkanApiVersion​(long struct)
        Unsafe version of vulkanApiVersion().
      • npTypeExternalMemoryHandleTypes

        @Nullable
        public static java.nio.IntBuffer npTypeExternalMemoryHandleTypes​(long struct,
                                                                         int capacity)
      • nflags

        public static void nflags​(long struct,
                                  int value)
        Unsafe version of flags.
      • nphysicalDevice

        public static void nphysicalDevice​(long struct,
                                           org.lwjgl.vulkan.VkPhysicalDevice value)
        Unsafe version of physicalDevice.
      • ndevice

        public static void ndevice​(long struct,
                                   org.lwjgl.vulkan.VkDevice value)
        Unsafe version of device.
      • npreferredLargeHeapBlockSize

        public static void npreferredLargeHeapBlockSize​(long struct,
                                                        long value)
        Unsafe version of preferredLargeHeapBlockSize.
      • npAllocationCallbacks

        public static void npAllocationCallbacks​(long struct,
                                                 @Nullable
                                                 org.lwjgl.vulkan.VkAllocationCallbacks value)
        Unsafe version of pAllocationCallbacks.
      • npHeapSizeLimit

        public static void npHeapSizeLimit​(long struct,
                                           @Nullable
                                           java.nio.LongBuffer value)
        Unsafe version of pHeapSizeLimit.
      • ninstance

        public static void ninstance​(long struct,
                                     org.lwjgl.vulkan.VkInstance value)
        Unsafe version of instance.
      • nvulkanApiVersion

        public static void nvulkanApiVersion​(long struct,
                                             int value)
        Unsafe version of vulkanApiVersion.
      • npTypeExternalMemoryHandleTypes

        public static void npTypeExternalMemoryHandleTypes​(long struct,
                                                           @Nullable
                                                           java.nio.IntBuffer value)
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate