e764a63f95
Adds a per-game FPS cap for the VRR present mode so games whose logic is tied to the frame rate (e.g. TOTK's menu cursor running wild at 200 fps) can be limited, while keeping G-Sync/FreeSync smoothing. The cap is off by default (VRR stays unbounded); 30/60/120 are exposed. Reuses the existing custom-VSync-interval plumbing: when VSyncMode is Vrr and the custom interval is enabled, SurfaceFlinger paces frames at that value (forcing a non-zero swap interval even when a Dynamic FPS mod submits 0) instead of running unbounded, while Window.cs keeps FifoRelaxed so the display still follows the frame rate. EnableCustomVSyncInterval is now read at Switch construction so the per-game setting applies at launch. UI: the VSync dropdown now offers Switch / Unbounded / VRR, with a VRR FPS cap picker shown only for VRR. The legacy Custom mode is hidden (kept in the enum for config compatibility) and the percentage slider / experimental checkbox are removed.
24 lines
638 B
C#
24 lines
638 B
C#
namespace Ryujinx.Common.Configuration
|
|
{
|
|
public enum VSyncMode
|
|
{
|
|
Switch,
|
|
Unbounded,
|
|
Custom,
|
|
Vrr
|
|
}
|
|
|
|
public static class VSyncModeExtensions
|
|
{
|
|
public static VSyncMode Next(this VSyncMode vsync, bool customEnabled = false) =>
|
|
vsync switch
|
|
{
|
|
VSyncMode.Switch => VSyncMode.Unbounded,
|
|
VSyncMode.Unbounded => VSyncMode.Vrr,
|
|
VSyncMode.Vrr => VSyncMode.Switch,
|
|
VSyncMode.Custom => VSyncMode.Switch, // legacy mode, no longer in the cycle
|
|
_ => VSyncMode.Switch
|
|
};
|
|
}
|
|
}
|