GS/Vulkan: Submit cmdbuffer each frame even when surfaceless

Stops out-of-descriptor scenarios which are not realistic in the GS
runner.
This commit is contained in:
Stenzek 2023-05-08 23:13:48 +10:00 committed by refractionpcsx2
parent 828e86bdf4
commit 3f0ecc2284
1 changed files with 10 additions and 3 deletions

View File

@ -373,9 +373,16 @@ GSDevice::PresentResult GSDeviceVK::BeginPresent(bool frame_skip)
{
EndRenderPass();
if (frame_skip || !m_swap_chain)
if (frame_skip)
return PresentResult::FrameSkipped;
// If we're running surfaceless, kick the command buffer so we don't run out of descriptors.
if (!m_swap_chain)
{
ExecuteCommandBuffer(false);
return PresentResult::FrameSkipped;
}
// Previous frame needs to be presented before we can acquire the swap chain.
g_vulkan_context->WaitForPresentComplete();
@ -399,7 +406,7 @@ GSDevice::PresentResult GSDeviceVK::BeginPresent(bool frame_skip)
if (!m_swap_chain->RecreateSurface(m_window_info))
{
Console.Error("Failed to recreate surface after loss");
g_vulkan_context->ExecuteCommandBuffer(VKContext::WaitType::None);
ExecuteCommandBuffer(false);
return PresentResult::FrameSkipped;
}
@ -412,7 +419,7 @@ GSDevice::PresentResult GSDeviceVK::BeginPresent(bool frame_skip)
{
// Still submit the command buffer, otherwise we'll end up with several frames waiting.
LOG_VULKAN_ERROR(res, "vkAcquireNextImageKHR() failed: ");
g_vulkan_context->ExecuteCommandBuffer(VKContext::WaitType::None);
ExecuteCommandBuffer(false);
return PresentResult::FrameSkipped;
}
}