Skip to content

Commit

Permalink
VulkanDevice: Add additional semaphore on swap chain
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stenzek committed Mar 8, 2024
1 parent 162354d commit 7ed6801
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pcsx2/GS/Renderers/Vulkan/VKSwapChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7ed6801

Please sign in to comment.