Introduce alternative FPS measurement for disabled frame throttling

The FPS is implicitly bound to the refresh rate due to the timestamp being that of the presentation time, this leads to a misleading FPS figure for disabled frame throttling. It has now been fixed by using the frame submission time rather than the presentation time when frame throttling is disabled and to make this more apparent the color of the OSD FPS has been changed.
This commit is contained in:
PixelyIon
2022-07-03 11:17:41 +05:30
parent 0f56d01e58
commit 2636a37b31
5 changed files with 10 additions and 4 deletions

View File

@ -191,7 +191,7 @@ namespace skyline::gpu {
}); // We don't care about suboptimal images as they are caused by not respecting the transform hint, we handle transformations externally
}
timestamp = timestamp ? timestamp : getMonotonicNsNow();
timestamp = (timestamp && !*state.settings->disableFrameThrottling) ? timestamp : getMonotonicNsNow(); // We tie FPS to the submission time rather than presentation timestamp, if we don't have the presentation timestamp available or if frame throttling is disabled as we want the maximum measured FPS to not be restricted to the refresh rate
if (frameTimestamp) {
i64 sampleWeight{Fps ? Fps : 1}; //!< The weight of each sample in calculating the average, we want to roughly average the past second