From d1026e4b5b4d03d794988e997bd0fe1d6977e8b8 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 8 Aug 2019 20:56:11 +0200 Subject: [PATCH] - call vkDeviceWaitIdle before RAII tears down buffers --- src/rendering/vulkan/system/vk_framebuffer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rendering/vulkan/system/vk_framebuffer.cpp b/src/rendering/vulkan/system/vk_framebuffer.cpp index 9b0008b00..9bed26c84 100644 --- a/src/rendering/vulkan/system/vk_framebuffer.cpp +++ b/src/rendering/vulkan/system/vk_framebuffer.cpp @@ -98,6 +98,8 @@ VulkanFrameBuffer::VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevi VulkanFrameBuffer::~VulkanFrameBuffer() { + vkDeviceWaitIdle(device->device); // make sure the GPU is no longer using any objects before RAII tears them down + // screen is already null at this point, but VkHardwareTexture::ResetAll needs it during clean up. Is there a better way we can do this? auto tmp = screen; screen = this;