Skip to content

Commit

Permalink
sync gpu: check disable flag before volatile
Browse files Browse the repository at this point in the history
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
  • Loading branch information
degasus committed Aug 24, 2013
1 parent 2017ab9 commit 1cbc8f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Core/VideoCommon/Src/Fifo.cpp
Expand Up @@ -154,7 +154,7 @@ void RunGpuLoop()
fifo.isGpuReadingData = true;
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;
u8 *uData = Memory::GetPointer(readPtr);
Expand All @@ -171,7 +171,7 @@ void RunGpuLoop()

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::AtomicStore(fifo.CPReadPointer, readPtr);
Expand Down

0 comments on commit 1cbc8f8

Please sign in to comment.