Vulkan: Fix leak and remove extra allocator.

The leak was because we restored immediately after initializing, and
therefore leaked several pipelines.

This allocator isn't used right now, so just using up memory.
This commit is contained in:
Unknown W. Brackets committed 2020-05-18 23:07:44 -07:00
1 parent cb23c0c01d
commit 966ac4458a
3 files changed
+2 -17

No files matched your search

+1 -16
View File
@@ -78,7 +78,7 @@ FramebufferManagerVulkan::FramebufferManagerVulkan(Draw::DrawContext *draw, Vulk
vulkan_(vulkan) {
presentation_->SetLanguage(GLSL_VULKAN);
DeviceRestore(vulkan, draw);
InitDeviceObjects();
// After a blit we do need to rebind for the VulkanRenderManager to know what to do.
needGLESRebinds_ = true;
@@ -410,17 +410,6 @@ void FramebufferManagerVulkan::DeviceLost() {
DestroyAllFBOs();
DestroyDeviceObjects();
presentation_->DeviceLost();
if (allocator_) {
allocator_->Destroy();
// We have to delete on queue, so this can free its queued deletions.
vulkan_->Delete().QueueCallback([](void *ptr) {
auto allocator = static_cast<VulkanDeviceAllocator *>(ptr);
delete allocator;
}, allocator_);
allocator_ = nullptr;
}
}
void FramebufferManagerVulkan::DeviceRestore(VulkanContext *vulkan, Draw::DrawContext *draw) {
@@ -428,9 +417,5 @@ void FramebufferManagerVulkan::DeviceRestore(VulkanContext *vulkan, Draw::DrawCo
draw_ = draw;
presentation_->DeviceRestore(draw);
_assert_(!allocator_);
allocator_ = new VulkanDeviceAllocator(vulkan_, 1 * 1024 * 1024, 8 * 1024 * 1024);
InitDeviceObjects();
}