From 1cbc8f8182246772dffc67a48fdebe77537d2a3d Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 24 Aug 2013 18:43:07 +0200 Subject: [PATCH] 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 --- Source/Core/VideoCommon/Src/Fifo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index a00e531fa4..b7e00e128a 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -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); @@ -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);