GS/DX12: Don't move to next command list until after wait

This commit is contained in:
TheLastRar
2025-12-29 02:16:59 +00:00
committed by lightningterror
parent 3a57bb46ab
commit 1fdc000815

View File

@@ -343,12 +343,14 @@ bool GSDevice12::CreateCommandLists()
void GSDevice12::MoveToNextCommandList()
{
m_current_command_list = (m_current_command_list + 1) % NUM_COMMAND_LISTS;
m_current_fence_value++;
const int next_command_list = (m_current_command_list + 1) % NUM_COMMAND_LISTS;
// We may have to wait if this command list hasn't finished on the GPU.
CommandListResources& res = m_command_lists[m_current_command_list];
CommandListResources& res = m_command_lists[next_command_list];
WaitForFence(res.ready_fence_value, false);
m_current_command_list = next_command_list;
m_current_fence_value++;
res.ready_fence_value = m_current_fence_value;
res.init_command_list_used = false;