From 13825c9ef7fb12d80dbd0ae856ce7ad40eb5e66e Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 16 Jun 2017 16:01:42 +0300 Subject: [PATCH] vk: Proper shutdown to avoid destroying resources still in use --- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 9565f2337a..1f19333185 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -633,7 +633,11 @@ VKGSRender::~VKGSRender() return; } - m_current_command_buffer->reset(); + //Close recording and wait for all to finish + CHECK_RESULT(vkEndCommandBuffer(*m_current_command_buffer)); + + for (auto &cb : m_primary_cb_list) + if (cb.pending) cb.wait(); //Wait for device to finish up with resources vkDeviceWaitIdle(*m_device);