return id;
}
+unsigned MemoryAllocator::allocate(VkImage image, MemoryType type)
+{
+ const VulkanFunctions &vk = device.get_functions();
+
+ VkMemoryRequirements requirements;
+ vk.GetImageMemoryRequirements(image, requirements);
+
+ unsigned id = allocate(requirements.size, requirements.memoryTypeBits, type);
+
+ vk.BindImageMemory(image, get_allocation(id).memory, 0);
+
+ return id;
+}
+
void MemoryAllocator::release(unsigned id)
{
Allocation &alloc = get_allocation(id);