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:21:14 +10:00 committed by Connor McLaughlin
parent 162354decf
commit 7ed6801101
1 changed files with 7 additions and 3 deletions

View File

@ -442,9 +442,13 @@ bool VKSwapChain::CreateSwapChain()
m_images.push_back(std::move(texture));
}
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;