mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-27 08:05:41 +00:00
VulkanHostDisplay: Ensure previous frame is presented before acquiring image
This commit is contained in:
parent
b1d4d5db5e
commit
4a60cc4c1e
|
@ -941,6 +941,9 @@ void Context::DoPresent(VkSemaphore wait_semaphore, VkSwapchainKHR present_swap_
|
|||
|
||||
void Context::WaitForPresentComplete()
|
||||
{
|
||||
if (m_present_done.load())
|
||||
return;
|
||||
|
||||
std::unique_lock<std::mutex> lock(m_present_mutex);
|
||||
WaitForPresentComplete(lock);
|
||||
}
|
||||
|
|
|
@ -602,6 +602,9 @@ bool VulkanHostDisplay::Render()
|
|||
return false;
|
||||
}
|
||||
|
||||
// Previous frame needs to be presented before we can acquire the swap chain.
|
||||
g_vulkan_context->WaitForPresentComplete();
|
||||
|
||||
VkResult res = m_swap_chain->AcquireNextImage();
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue