diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index adb9613213..fd56ca3214 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -27,7 +27,6 @@ #include "VideoCommon/AVIDump.h" #include "VideoCommon/BPFunctions.h" #include "VideoCommon/Fifo.h" -#include "VideoCommon/FPSCounter.h" #include "VideoCommon/ImageWrite.h" #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/PixelEngine.h" @@ -38,8 +37,6 @@ namespace DX11 { -static int s_fps = 0; - static u32 s_LastAA = 0; static Television s_television; @@ -181,8 +178,6 @@ Renderer::Renderer(void *&window_handle) { int x, y, w_temp, h_temp; - FPSCounter::Initialize(); - Host_GetRenderWindowSize(x, y, w_temp, h_temp); D3D::Create((HWND)window_handle); @@ -952,10 +947,6 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl FramebufferManagerBase::SetLastXfbHeight(h); } - // update FPS counter - if (XFBWrited) - s_fps = FPSCounter::Update(); - // Flip/present backbuffer to frontbuffer here D3D::Present(); diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index f2567c0c8b..a261a28cb6 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -36,7 +36,6 @@ #include "VideoCommon/BPStructs.h" #include "VideoCommon/DriverDetails.h" #include "VideoCommon/Fifo.h" -#include "VideoCommon/FPSCounter.h" #include "VideoCommon/ImageWrite.h" #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/PixelEngine.h" @@ -85,7 +84,6 @@ VideoConfig g_ogl_config; // Declarations and definitions // ---------------------------- -static int s_fps = 0; static GLuint s_ShowEFBCopyRegions_VBO = 0; static GLuint s_ShowEFBCopyRegions_VAO = 0; static SHADER s_ShowEFBCopyRegions; @@ -340,7 +338,6 @@ Renderer::Renderer() s_fps=0; s_ShowEFBCopyRegions_VBO = 0; s_blendMode = 0; - FPSCounter::Initialize(); bool bSuccess = true; @@ -1583,8 +1580,6 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl } } - if (XFBWrited) - s_fps = FPSCounter::Update(); // --------------------------------------------------------------------- if (!DriverDetails::HasBug(DriverDetails::BUG_BROKENSWAP)) { diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 2c95cdf89d..aa8a9f1d27 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -29,6 +29,7 @@ #include "VideoCommon/CPMemory.h" #include "VideoCommon/Debugger.h" #include "VideoCommon/Fifo.h" +#include "VideoCommon/FPSCounter.h" #include "VideoCommon/FramebufferManagerBase.h" #include "VideoCommon/MainBase.h" #include "VideoCommon/OpcodeDecoding.h" @@ -64,6 +65,8 @@ int Renderer::s_LastEFBScale; bool Renderer::s_skipSwap; bool Renderer::XFBWrited; +unsigned int Renderer::s_fps = 0; + PEControl::PixelFormat Renderer::prev_efb_format = PEControl::INVALID_FMT; unsigned int Renderer::efb_scale_numeratorX = 1; unsigned int Renderer::efb_scale_numeratorY = 1; @@ -84,6 +87,8 @@ Renderer::Renderer() OSDChoice = 0; OSDTime = 0; + + FPSCounter::Initialize(); } Renderer::~Renderer() @@ -521,6 +526,9 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& // TODO: merge more generic parts into VideoCommon g_renderer->SwapImpl(xfbAddr, fbWidth, fbHeight, rc, Gamma); + if (XFBWrited) + s_fps = FPSCounter::Update(); + frameCount++; GFX_DEBUGGER_PAUSE_AT(NEXT_FRAME, true); diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index 16b17ae8de..668a2a42eb 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -150,6 +150,8 @@ protected: static bool s_skipSwap; static bool XFBWrited; + static unsigned int s_fps; + private: static PEControl::PixelFormat prev_efb_format; static unsigned int efb_scale_numeratorX;