From 013e9bed93e46b20689148ead4862aa1cb8efab1 Mon Sep 17 00:00:00 2001 From: hyperiris Date: Mon, 9 Feb 2009 14:24:39 +0000 Subject: [PATCH] optimize function call: point out by magumagu, GetVideo() is a kind of bottleneck, so move it out of loop; git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2173 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/CommandProcessor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/HW/CommandProcessor.cpp b/Source/Core/Core/Src/HW/CommandProcessor.cpp index 216eb236f1..f593506fc2 100644 --- a/Source/Core/Core/Src/HW/CommandProcessor.cpp +++ b/Source/Core/Core/Src/HW/CommandProcessor.cpp @@ -646,6 +646,8 @@ void CatchUpGPU() { // HyperIris: Memory::GetPointer is an expensive call, call it less, run faster u8 *ptr = Memory::GetPointer(fifo.CPReadPointer); + // HyperIris: point out by magumagu, GetVideo() is a bottleneck, so move it out of loop; + Common::PluginVideo * pVideo = CPluginManager::GetInstance().GetVideo(); while (fifo.CPReadWriteDistance > 0) { @@ -669,7 +671,7 @@ void CatchUpGPU() // We are going to do FP math on the main thread so have to save the current state SaveSSEState(); LoadDefaultSSEState(); - CPluginManager::GetInstance().GetVideo()->Video_SendFifoData(ptr,32); + pVideo->Video_SendFifoData(ptr,32); LoadSSEState(); // adjust ptr += 32;