Interface VMAAllocatorType
- All Superinterfaces:
AutoCloseable, com.io7m.jmulticlose.core.CloseableType, VulkanHandleDispatchableType, VulkanHandleType
- All Known Implementing Classes:
VMALWJGLAllocator
A configured VMA allocator.
-
Method Summary
Modifier and TypeMethodDescriptionCalculate the full statistics for the allocator.createBuffer(VMAAllocationCreateInfo alloc_create_info, VulkanBufferCreateInfo buffer_create_info) Allocate a buffer.createImage(VMAAllocationCreateInfo alloc_create_info, VulkanImageCreateInfo image_create_info) Allocate an image.Get the current memory usage and recommended budget for each memory heap.mapMemory(VMAAllocationType allocation) Map the memory associated with the given allocation.voidsetCurrentFrameIndex(int frame_index) Set the current frame index.Methods inherited from interface com.io7m.jmulticlose.core.CloseableType
isClosedMethods inherited from interface VulkanHandleType
close
-
Method Details
-
createBuffer
VMAAllocationResult<VulkanBufferType> createBuffer(VMAAllocationCreateInfo alloc_create_info, VulkanBufferCreateInfo buffer_create_info) throws VulkanException Allocate a buffer.- Parameters:
alloc_create_info- The allocation creation infobuffer_create_info- The buffer creation info- Returns:
- An allocation
- Throws:
VulkanException- On errors
-
createImage
VMAAllocationResult<VulkanImageType> createImage(VMAAllocationCreateInfo alloc_create_info, VulkanImageCreateInfo image_create_info) throws VulkanException Allocate an image.- Parameters:
alloc_create_info- The allocation creation infoimage_create_info- The image creation info- Returns:
- An allocation
- Throws:
VulkanException- On errors
-
mapMemory
Map the memory associated with the given allocation.- Parameters:
allocation- The VMA allocation- Returns:
- The memory, mapped
- Throws:
VulkanException- On errors
-
getHeapBudgets
Get the current memory usage and recommended budget for each memory heap.- Returns:
- A list of heap budgets, indexed by heap index
- Throws:
VulkanException- On errors
-
calculateStatistics
Calculate the full statistics for the allocator. This traverses all internal allocator data structures and is more expensive thangetHeapBudgets(). Intended for periodic monitoring or debugging, not for per-frame use.- Returns:
- The full statistics
- Throws:
VulkanException- On errors
-
setCurrentFrameIndex
Set the current frame index. Call once per frame when the allocator was created with VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT, so that the budget is queried from the Vulkan device.- Parameters:
frame_index- The frame index- Throws:
VulkanException- On errors
-