Make vk_allocator a singleton
This commit is contained in:
@@ -569,12 +569,11 @@ void application::initialize_vulkan()
|
||||
|
||||
pipeline_cache = vk::raii::PipelineCache(vk_device, pipeline_cache_info);
|
||||
|
||||
VmaAllocatorCreateInfo info{
|
||||
allocator.emplace(VmaAllocatorCreateInfo{
|
||||
.physicalDevice = *vk_physical_device,
|
||||
.device = *vk_device,
|
||||
.instance = *vk_instance,
|
||||
};
|
||||
CHECK_VK(vmaCreateAllocator(&info, &allocator));
|
||||
});
|
||||
}
|
||||
|
||||
void application::log_views()
|
||||
@@ -997,12 +996,6 @@ void application::cleanup()
|
||||
i->spaces_by_name.clear();
|
||||
}
|
||||
|
||||
if (allocator)
|
||||
{
|
||||
vmaDestroyAllocator(allocator);
|
||||
allocator = nullptr;
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
jni::jni_thread::detach();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user