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
No known key found for this signature in database
GPG Key ID: 11BC6C3201BC2C05
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

View File

@ -295,6 +295,9 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
)
if (preferenceSettings.perfStats) {
if (preferenceSettings.disableFrameThrottling)
binding.perfStats.setTextColor(getColor(R.color.colorPerfStatsSecondary))
binding.perfStats.apply {
postDelayed(object : Runnable {
override fun run() {

View File

@ -27,8 +27,8 @@
android:layout_gravity="top|left"
android:layout_marginLeft="@dimen/onScreenItemHorizontalMargin"
android:layout_marginTop="5dp"
android:textColor="#9fffff00"
tools:text="60 FPS \n16.7±1.20ms" />
tools:text="60 FPS\n16.6±0.10ms"
android:textColor="@color/colorPerfStatsPrimary" />
<ImageButton
android:id="@+id/on_screen_controller_toggle"

View File

@ -5,4 +5,7 @@
<color name="backgroundColor">@android:color/white</color>
<color name="backgroundColorVariant">#F8F8F8</color>
<color name="dividerColor">@android:color/black</color>
<color name="colorPerfStatsPrimary">#9FFFFF00</color>
<color name="colorPerfStatsSecondary">#9F00FFFF</color>
</resources>

View File

@ -60,7 +60,7 @@
<string name="triple_buffering_enabled">Utilize at least three swapchain buffers (Higher FPS but more input lag)</string>
<string name="triple_buffering_disabled">Utilize at least two swapchain buffers (Lower FPS but less input lag)</string>
<string name="disable_frame_throttling">Disable Frame Throttling</string>
<string name="disable_frame_throttling_enabled">Game is allowed to submit frames as fast as possible (Only for benchmarking)</string>
<string name="disable_frame_throttling_enabled">Game is allowed to submit frames as fast as possible (Only for benchmarking)\n\n<b>Note:</b> An alternative method is utilized to measure the FPS with this enabled, the figures must not be compared to throttled FPS figures</string>
<string name="disable_frame_throttling_disabled">Only allow the game to submit frames at the display refresh rate</string>
<string name="max_refresh_rate">Use Maximum Display Refresh Rate</string>
<string name="max_refresh_rate_enabled">Sets the display refresh rate as high as possible (Will break most games)</string>