Don't present BGFX_FRAME_FLUSH frames. Fixed D3D12/VK flush sync. (#3771)

This commit is contained in:
Branimir Karadžić
2026-06-19 19:39:42 +00:00
committed by GitHub
parent 09eaac37ae
commit 4f101d98be
5 changed files with 20 additions and 6 deletions
+13 -5
View File
@@ -8384,6 +8384,9 @@ VK_DESTROY
m_lastImageRenderedSemaphore = m_renderDoneSemaphore[m_backBufferColorIdx];
m_needPresent = true;
s_renderVK->m_cmd.addWaitSemaphore(m_lastImageAcquiredSemaphore, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
m_lastImageAcquiredSemaphore = VK_NULL_HANDLE;
}
return true;
@@ -8903,15 +8906,20 @@ VK_DESTROY
return result;
}
void CommandQueueVK::addWaitSemaphore(VkSemaphore _semaphore, VkPipelineStageFlags _waitStage)
{
BX_ASSERT(m_numWaitSemaphores < BX_COUNTOF(m_waitSemaphores), "Too many wait semaphores.");
m_waitSemaphores[m_numWaitSemaphores] = _semaphore;
m_waitSemaphoreStages[m_numWaitSemaphores] = _waitStage;
m_numWaitSemaphores++;
}
void CommandQueueVK::addSwapChain(SwapChainVK& _swapChain)
{
if (VK_NULL_HANDLE != _swapChain.m_lastImageAcquiredSemaphore)
{
BX_ASSERT(m_numWaitSemaphores < BX_COUNTOF(m_waitSemaphores), "Too many wait semaphores.");
m_waitSemaphores[m_numWaitSemaphores] = _swapChain.m_lastImageAcquiredSemaphore;
m_waitSemaphoreStages[m_numWaitSemaphores] = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT;
m_numWaitSemaphores++;
addWaitSemaphore(_swapChain.m_lastImageAcquiredSemaphore, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
_swapChain.m_lastImageAcquiredSemaphore = VK_NULL_HANDLE;
}