misc: Add ANGLE configuration option to JSON and CLI (#6520)

* Add hardware-acceleration toggle to ConfigurationState.

* Add command line override for easier RenderDoc use.

* Adjust CLI arguments.

* fix whitespace format check

* fix copypasta in comment

* Add X11 rendering mode toggle

* Remove ANGLE specific comments.
This commit is contained in:
MutantAura 2024-04-06 18:58:02 +01:00 committed by GitHub
parent 12b235700c
commit 451a28afb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 3 deletions

View file

@ -60,12 +60,16 @@ namespace Ryujinx.Ava
EnableMultiTouch = true,
EnableIme = true,
EnableInputFocusProxy = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP") == "gamescope",
RenderingMode = new[] { X11RenderingMode.Glx, X11RenderingMode.Software },
RenderingMode = ConfigurationState.Instance.EnableHardwareAcceleration ?
new[] { X11RenderingMode.Glx, X11RenderingMode.Software } :
new[] { X11RenderingMode.Software },
})
.With(new Win32PlatformOptions
{
WinUICompositionBackdropCornerRadius = 8.0f,
RenderingMode = new[] { Win32RenderingMode.AngleEgl, Win32RenderingMode.Software },
RenderingMode = ConfigurationState.Instance.EnableHardwareAcceleration ?
new[] { Win32RenderingMode.AngleEgl, Win32RenderingMode.Software } :
new[] { Win32RenderingMode.Software },
})
.UseSkia();
}
@ -191,6 +195,12 @@ namespace Ryujinx.Ava
_ => ConfigurationState.Instance.HideCursor.Value,
};
}
// Check if hardware-acceleration was overridden.
if (CommandLineState.OverrideHardwareAcceleration != null)
{
ConfigurationState.Instance.EnableHardwareAcceleration.Value = CommandLineState.OverrideHardwareAcceleration.Value;
}
}
private static void PrintSystemInfo()