Vulkan Memory Allocator
General considerations

Thread safety

Allocation algorithm

The library uses following algorithm for allocation, in order:

  1. Try to find free range of memory in existing blocks.
  2. If failed, try to create a new block of VkDeviceMemory, with preferred block size.
  3. If failed, try to create such block with size/2, size/4, size/8.
  4. If failed and VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag was specified, try to find space in existing blocks, possilby making some other allocations lost.
  5. If failed, try to allocate separate VkDeviceMemory for this allocation, just like when you use VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
  6. If failed, choose other memory type that meets the requirements specified in VmaAllocationCreateInfo and go to point 1.
  7. If failed, return VK_ERROR_OUT_OF_DEVICE_MEMORY.

Features not supported

Features deliberately excluded from the scope of this library: