vk: Proper shutdown to avoid destroying resources still in use

This commit is contained in:
kd-11 2017-06-16 16:01:42 +03:00
parent 6013b0782e
commit 13825c9ef7
1 changed files with 5 additions and 1 deletions

View File

@ -633,7 +633,11 @@ VKGSRender::~VKGSRender()
return; 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 //Wait for device to finish up with resources
vkDeviceWaitIdle(*m_device); vkDeviceWaitIdle(*m_device);