Remove the need for waitIdle from Vulkan.

This commit is contained in:
Dario 2025-03-13 19:08:35 -03:00
parent d0368665dd
commit 9b7625f03e

View file

@ -1973,23 +1973,21 @@ void Video::WaitForGPU()
{ {
g_waitForGPUCount++; g_waitForGPUCount++;
if (g_vulkan) // Wait for all queue frames to finish.
for (size_t i = 0; i < NUM_FRAMES; i++)
{ {
g_device->waitIdle(); if (g_commandListStates[i])
}
else
{
for (size_t i = 0; i < NUM_FRAMES; i++)
{ {
if (g_commandListStates[i]) g_queue->waitForCommandFence(g_commandFences[i].get());
{ g_commandListStates[i] = false;
g_queue->waitForCommandFence(g_commandFences[i].get());
g_commandListStates[i] = false;
}
} }
g_queue->executeCommandLists(nullptr, g_commandFences[0].get());
g_queue->waitForCommandFence(g_commandFences[0].get());
} }
// Execute an empty command list and wait for it to end to guarantee that any remaining presentation has finished.
g_commandLists[0]->begin();
g_commandLists[0]->end();
g_queue->executeCommandLists(g_commandLists[0].get(), g_commandFences[0].get());
g_queue->waitForCommandFence(g_commandFences[0].get());
} }
static uint32_t CreateDevice(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4, uint32_t a5, be<uint32_t>* a6) static uint32_t CreateDevice(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4, uint32_t a5, be<uint32_t>* a6)