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:
Stenzek
2024-03-08 14:16:52 +10:00
parent 7159330f63
commit de1338cbbc
3 changed files with 12 additions and 9 deletions

View File

@ -534,9 +534,13 @@ bool VulkanSwapChain::CreateSwapChain()
m_images.push_back(image);
}
m_semaphores.reserve(image_count);
m_current_semaphore = (image_count - 1);
for (u32 i = 0; i < image_count; i++)
// 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.
const u32 semaphore_count = image_count + 1;
m_semaphores.reserve(semaphore_count);
m_current_semaphore = 0;
for (u32 i = 0; i < semaphore_count; i++)
{
ImageSemaphores sema;