mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
Marginally improve FPS counting logic in the video plugins.
Should fix DX11 peaking at 59 FPS instead of 60 FPS. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6026 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
910d543536
commit
d411924eee
@ -1004,11 +1004,11 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
|
|||||||
|
|
||||||
// update FPS counter
|
// update FPS counter
|
||||||
static int fpscount = 0;
|
static int fpscount = 0;
|
||||||
static unsigned long lasttime = Common::Timer::GetTimeMs();
|
static unsigned long lasttime = 0;
|
||||||
if (Common::Timer::GetTimeMs() - lasttime >= 1000)
|
if (Common::Timer::GetTimeMs() - lasttime >= 1000)
|
||||||
{
|
{
|
||||||
lasttime = Common::Timer::GetTimeMs();
|
lasttime = Common::Timer::GetTimeMs();
|
||||||
s_fps = fpscount-1;
|
s_fps = fpscount;
|
||||||
fpscount = 0;
|
fpscount = 0;
|
||||||
}
|
}
|
||||||
if (XFBWrited) ++fpscount;
|
if (XFBWrited) ++fpscount;
|
||||||
|
@ -1271,16 +1271,16 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
// Count FPS.
|
// Count FPS.
|
||||||
// -------------
|
// -------------
|
||||||
static int fpscount = 1;
|
static int fpscount = 0;
|
||||||
static unsigned long lasttime;
|
static unsigned long lasttime = 0;
|
||||||
if (XFBWrited)
|
if (Common::Timer::GetTimeMs() - lasttime >= 1000)
|
||||||
++fpscount;
|
|
||||||
if (Common::Timer::GetTimeMs() - lasttime > 1000)
|
|
||||||
{
|
{
|
||||||
lasttime = Common::Timer::GetTimeMs();
|
lasttime = Common::Timer::GetTimeMs();
|
||||||
s_fps = fpscount - 1;
|
s_fps = fpscount;
|
||||||
fpscount = 1;
|
fpscount = 0;
|
||||||
}
|
}
|
||||||
|
if (XFBWrited)
|
||||||
|
++fpscount;
|
||||||
|
|
||||||
// Begin new frame
|
// Begin new frame
|
||||||
// Set default viewport and scissor, for the clear to work correctly
|
// Set default viewport and scissor, for the clear to work correctly
|
||||||
|
@ -571,7 +571,6 @@ TargetRectangle Renderer::ConvertEFBRectangle(const EFBRectangle& rc)
|
|||||||
return g_framebufferManager.ConvertEFBRectangle(rc);
|
return g_framebufferManager.ConvertEFBRectangle(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Renderer::ResetAPIState()
|
void Renderer::ResetAPIState()
|
||||||
{
|
{
|
||||||
// Gets us to a reasonably sane state where it's possible to do things like
|
// Gets us to a reasonably sane state where it's possible to do things like
|
||||||
@ -1202,14 +1201,14 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
|
|||||||
// Count FPS.
|
// Count FPS.
|
||||||
// -------------
|
// -------------
|
||||||
static int fpscount = 0;
|
static int fpscount = 0;
|
||||||
static unsigned long lasttime;
|
static unsigned long lasttime = 0;
|
||||||
++fpscount;
|
if (Common::Timer::GetTimeMs() - lasttime >= 1000)
|
||||||
if (Common::Timer::GetTimeMs() - lasttime > 1000)
|
|
||||||
{
|
{
|
||||||
lasttime = Common::Timer::GetTimeMs();
|
lasttime = Common::Timer::GetTimeMs();
|
||||||
s_fps = fpscount - 1;
|
s_fps = fpscount;
|
||||||
fpscount = 0;
|
fpscount = 0;
|
||||||
}
|
}
|
||||||
|
++fpscount;
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
GL_REPORT_ERRORD();
|
GL_REPORT_ERRORD();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user