mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Implement a simple benchmarking mode which logs FPS to a file
Very useful to compare performance between two builds, check the impact of a configuration option, etc. FPS log is stored in User/Logs/fps.txt and is reset each time you launch a game. Only enabled if you check the "Log FPS to file" option in your graphics settings. Could be improved a bit: currently logs only every 1s (so you can't really see small variations), maybe output more infos to the fps.txt like average/stddev (but Excel/Libreoffice/Google Docs can compute that easily too).
This commit is contained in:
@ -44,6 +44,7 @@
|
||||
#include "Host.h"
|
||||
#include "BPFunctions.h"
|
||||
#include "AVIDump.h"
|
||||
#include "FPSCounter.h"
|
||||
|
||||
namespace DX11
|
||||
{
|
||||
@ -338,6 +339,8 @@ Renderer::Renderer()
|
||||
int x, y, w_temp, h_temp;
|
||||
s_blendMode = 0;
|
||||
|
||||
InitFPSCounter();
|
||||
|
||||
Host_GetRenderWindowSize(x, y, w_temp, h_temp);
|
||||
|
||||
D3D::Create(EmuWindow::GetWnd());
|
||||
@ -1143,16 +1146,8 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
|
||||
}
|
||||
|
||||
// update FPS counter
|
||||
static int fpscount = 0;
|
||||
static unsigned long lasttime = 0;
|
||||
if (Common::Timer::GetTimeMs() - lasttime >= 1000)
|
||||
{
|
||||
lasttime = Common::Timer::GetTimeMs();
|
||||
s_fps = fpscount;
|
||||
fpscount = 0;
|
||||
}
|
||||
if (XFBWrited)
|
||||
++fpscount;
|
||||
s_fps = UpdateFPSCounter();
|
||||
|
||||
// Begin new frame
|
||||
// Set default viewport and scissor, for the clear to work correctly
|
||||
|
Reference in New Issue
Block a user