diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/perf_stats.cpp | 2 | ||||
| -rw-r--r-- | src/core/perf_stats.h | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index eb59a1332..2cdfb9ded 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -76,7 +76,7 @@ double PerfStats::GetLastFrameTimeScale() { | |||
| 76 | 76 | ||
| 77 | void FrameLimiter::DoFrameLimiting(u64 current_system_time_us) { | 77 | void FrameLimiter::DoFrameLimiting(u64 current_system_time_us) { |
| 78 | // Max lag caused by slow frames. Can be adjusted to compensate for too many slow frames. Higher | 78 | // Max lag caused by slow frames. Can be adjusted to compensate for too many slow frames. Higher |
| 79 | // values increases time needed to limit frame rate after spikes. | 79 | // values increase the time needed to recover and limit framerate again after spikes. |
| 80 | constexpr microseconds MAX_LAG_TIME_US = 25ms; | 80 | constexpr microseconds MAX_LAG_TIME_US = 25ms; |
| 81 | 81 | ||
| 82 | if (!Settings::values.toggle_framelimit) { | 82 | if (!Settings::values.toggle_framelimit) { |
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h index b03adab68..362b205c8 100644 --- a/src/core/perf_stats.h +++ b/src/core/perf_stats.h | |||
| @@ -44,15 +44,24 @@ public: | |||
| 44 | private: | 44 | private: |
| 45 | std::mutex object_mutex; | 45 | std::mutex object_mutex; |
| 46 | 46 | ||
| 47 | /// Point when the cumulative counters were reset | ||
| 47 | Clock::time_point reset_point = Clock::now(); | 48 | Clock::time_point reset_point = Clock::now(); |
| 49 | /// System time when the cumulative counters were reset | ||
| 50 | u64 reset_point_system_us = 0; | ||
| 48 | 51 | ||
| 49 | Clock::time_point frame_begin = reset_point; | 52 | /// Cumulative duration (excluding v-sync/frame-limiting) of frames since last reset |
| 50 | Clock::time_point previous_frame_end = reset_point; | ||
| 51 | Clock::duration accumulated_frametime = Clock::duration::zero(); | 53 | Clock::duration accumulated_frametime = Clock::duration::zero(); |
| 52 | Clock::duration previous_frame_length = Clock::duration::zero(); | 54 | /// Cumulative number of system frames (LCD VBlanks) presented since last reset |
| 53 | u64 reset_point_system_us = 0; | ||
| 54 | u32 system_frames = 0; | 55 | u32 system_frames = 0; |
| 56 | /// Cumulative number of game frames (GSP frame submissions) since last reset | ||
| 55 | u32 game_frames = 0; | 57 | u32 game_frames = 0; |
| 58 | |||
| 59 | /// Point when the previous system frame ended | ||
| 60 | Clock::time_point previous_frame_end = reset_point; | ||
| 61 | /// Point when the current system frame began | ||
| 62 | Clock::time_point frame_begin = reset_point; | ||
| 63 | /// Total visible duration (including frame-limiting, etc.) of the previous system frame | ||
| 64 | Clock::duration previous_frame_length = Clock::duration::zero(); | ||
| 56 | }; | 65 | }; |
| 57 | 66 | ||
| 58 | class FrameLimiter { | 67 | class FrameLimiter { |