VulkanDevice: Add additional semaphore on swap chain
We don't actually need +1 semaphores, or, more than one really. But, the validation layer gets cranky if we don't fence wait before the next image acquire. So, add an additional semaphore to ensure that we're never acquiring before fence waiting.
This commit is contained in:
@ -1272,7 +1272,7 @@ void VulkanDevice::SubmitCommandBuffer(VulkanSwapChain* present_swap_chain /* =
|
||||
{
|
||||
DoSubmitCommandBuffer(m_current_frame, present_swap_chain);
|
||||
if (present_swap_chain)
|
||||
DoPresent(present_swap_chain, false);
|
||||
DoPresent(present_swap_chain);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1317,7 +1317,7 @@ void VulkanDevice::DoSubmitCommandBuffer(u32 index, VulkanSwapChain* present_swa
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanDevice::DoPresent(VulkanSwapChain* present_swap_chain, bool acquire_next)
|
||||
void VulkanDevice::DoPresent(VulkanSwapChain* present_swap_chain)
|
||||
{
|
||||
const VkPresentInfoKHR present_info = {VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
|
||||
nullptr,
|
||||
@ -1344,8 +1344,7 @@ void VulkanDevice::DoPresent(VulkanSwapChain* present_swap_chain, bool acquire_n
|
||||
// Grab the next image as soon as possible, that way we spend less time blocked on the next
|
||||
// submission. Don't care if it fails, we'll deal with that at the presentation call site.
|
||||
// Credit to dxvk for the idea.
|
||||
if (acquire_next)
|
||||
present_swap_chain->AcquireNextImage();
|
||||
present_swap_chain->AcquireNextImage();
|
||||
}
|
||||
|
||||
void VulkanDevice::WaitForPresentComplete()
|
||||
@ -1379,7 +1378,7 @@ void VulkanDevice::PresentThread()
|
||||
|
||||
DoSubmitCommandBuffer(m_queued_present.command_buffer_index, m_queued_present.swap_chain);
|
||||
if (m_queued_present.swap_chain)
|
||||
DoPresent(m_queued_present.swap_chain, true);
|
||||
DoPresent(m_queued_present.swap_chain);
|
||||
m_present_done.store(true, std::memory_order_release);
|
||||
m_present_done_cv.notify_one();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user