sync gpu: check disable flag before volatile

This could be an optimizing as this condition could be moved out of the loop.
So we save an atomic load.
But I don't know if it matters at all
This commit is contained in:
degasus 2013-08-24 18:43:07 +02:00
parent 2017ab9323
commit 1cbc8f8182
1 changed files with 2 additions and 2 deletions

View File

@ -154,7 +154,7 @@ void RunGpuLoop()
fifo.isGpuReadingData = true; fifo.isGpuReadingData = true;
CommandProcessor::isPossibleWaitingSetDrawDone = fifo.bFF_GPLinkEnable ? true : false; CommandProcessor::isPossibleWaitingSetDrawDone = fifo.bFF_GPLinkEnable ? true : false;
if (Common::AtomicLoad(CommandProcessor::VITicks) > CommandProcessor::m_cpClockOrigin || !Core::g_CoreStartupParameter.bSyncGPU) if (!Core::g_CoreStartupParameter.bSyncGPU || Common::AtomicLoad(CommandProcessor::VITicks) > CommandProcessor::m_cpClockOrigin)
{ {
u32 readPtr = fifo.CPReadPointer; u32 readPtr = fifo.CPReadPointer;
u8 *uData = Memory::GetPointer(readPtr); u8 *uData = Memory::GetPointer(readPtr);
@ -171,7 +171,7 @@ void RunGpuLoop()
cyclesExecuted = OpcodeDecoder_Run(g_bSkipCurrentFrame); cyclesExecuted = OpcodeDecoder_Run(g_bSkipCurrentFrame);
if (Common::AtomicLoad(CommandProcessor::VITicks) > cyclesExecuted && Core::g_CoreStartupParameter.bSyncGPU) if (Core::g_CoreStartupParameter.bSyncGPU && Common::AtomicLoad(CommandProcessor::VITicks) > cyclesExecuted)
Common::AtomicAdd(CommandProcessor::VITicks, -(s32)cyclesExecuted); Common::AtomicAdd(CommandProcessor::VITicks, -(s32)cyclesExecuted);
Common::AtomicStore(fifo.CPReadPointer, readPtr); Common::AtomicStore(fifo.CPReadPointer, readPtr);