aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/perf_stats.h
diff options
context:
space:
mode:
authorbunnei <[email protected]>2021-05-18 19:56:29 -0700
committerGitHub <[email protected]>2021-05-18 19:56:29 -0700
commit7d86a6ff02e0778aa69ec52ef5c0eb0d26200818 (patch)
treeec9657e464e62c444ee2062cb0110b7e710d9788 /src/core/perf_stats.h
parent61f293e5c98f4dc93f366c85caa2628da8d63205 (diff)
parent5bef54618a2850e42f7bab45120dab9166468a25 (diff)
downloadyuzu-mainline-7d86a6ff02e0778aa69ec52ef5c0eb0d26200818.tar.gz
yuzu-mainline-7d86a6ff02e0778aa69ec52ef5c0eb0d26200818.zip
Merge pull request #6317 from ameerj/fps-fix
perf_stats: Rework FPS counter to be more accurate
Diffstat (limited to 'src/core/perf_stats.h')
-rw-r--r--src/core/perf_stats.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h
index ae4698696..e5d603717 100644
--- a/src/core/perf_stats.h
+++ b/src/core/perf_stats.h
@@ -5,6 +5,7 @@
#pragma once
#include <array>
+#include <atomic>
#include <chrono>
#include <cstddef>
#include <mutex>
@@ -15,8 +16,8 @@ namespace Core {
struct PerfStatsResults {
/// System FPS (LCD VBlanks) in Hz
double system_fps;
- /// Game FPS (GSP frame submissions) in Hz
- double game_fps;
+ /// Average game FPS (GPU frame renders) in Hz
+ double average_game_fps;
/// Walltime per system frame, in seconds, excluding any waits
double frametime;
/// Ratio of walltime / emulated time elapsed
@@ -72,7 +73,7 @@ private:
/// Cumulative number of system frames (LCD VBlanks) presented since last reset
u32 system_frames = 0;
/// Cumulative number of game frames (GSP frame submissions) since last reset
- u32 game_frames = 0;
+ std::atomic<u32> game_frames = 0;
/// Point when the previous system frame ended
Clock::time_point previous_frame_end = reset_point;
@@ -80,6 +81,8 @@ private:
Clock::time_point frame_begin = reset_point;
/// Total visible duration (including frame-limiting, etc.) of the previous system frame
Clock::duration previous_frame_length = Clock::duration::zero();
+ /// Previously computed fps
+ double previous_fps = 0;
};
class FrameLimiter {