From 4fbb245382712495a94daa3acf5437c9766fe148 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 5 Mar 2014 23:24:18 -0800 Subject: [PATCH] Avoid leaving the fast runloop on jumps. Jumps are actually very common in some games, like FF4 and Crisis Core, and tons more. They are used to jump around vertex data. Improves performance by a few percent in FF4. --- GPU/GPUCommon.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 1b7d604514..0fed1c8e72 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -565,8 +565,12 @@ void GPUCommon::UpdatePC(u32 currentPC, u32 newPC) { gpuStats.gpuCommandsAtCallLevel[std::min(currentList->stackptr, 3)] += executed; - // Exit the runloop and recalculate things. This isn't common. - downcount = 0; + // Exit the runloop and recalculate things. This happens a lot in some games. + easy_guard innerGuard(listLock); + if (currentList) + downcount = currentList->stall == 0 ? 0x0FFFFFFF : (currentList->stall - cycleLastPC) / 4; + else + downcount = 0; } void GPUCommon::ReapplyGfxState() {