diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index eab9c8f73..b8efdbbf4 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -383,4 +383,11 @@ std::optional MemoryAllocator::FindType(VkMemoryPropertyFlags flags, u32 ty return std::nullopt; } +void MemoryAllocator::NukeAllAllocations() { + // This calls the destructor for every MemoryAllocation slab. + // Each slab contains a Vulkan handle that will now call vkFreeMemory. + allocations.clear(); + allocations.shrink_to_fit(); +} + } // namespace Vulkan