aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Ryujinx.UI.Common/Configuration/ConfigurationFileFormat.cs7
-rw-r--r--src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs18
-rw-r--r--src/Ryujinx.UI.Common/Helper/CommandLineState.cs7
-rw-r--r--src/Ryujinx/Program.cs14
4 files changed, 43 insertions, 3 deletions
diff --git a/src/Ryujinx.UI.Common/Configuration/ConfigurationFileFormat.cs b/src/Ryujinx.UI.Common/Configuration/ConfigurationFileFormat.cs
index 0f6c21ef2..3387e1be1 100644
--- a/src/Ryujinx.UI.Common/Configuration/ConfigurationFileFormat.cs
+++ b/src/Ryujinx.UI.Common/Configuration/ConfigurationFileFormat.cs
@@ -15,7 +15,7 @@ namespace Ryujinx.UI.Common.Configuration
15 /// <summary> 15 /// <summary>
16 /// The current version of the file format 16 /// The current version of the file format
17 /// </summary> 17 /// </summary>
18 public const int CurrentVersion = 49; 18 public const int CurrentVersion = 50;
19 19
20 /// <summary> 20 /// <summary>
21 /// Version of the configuration file format 21 /// Version of the configuration file format
@@ -163,6 +163,11 @@ namespace Ryujinx.UI.Common.Configuration
163 public bool ShowConfirmExit { get; set; } 163 public bool ShowConfirmExit { get; set; }
164 164
165 /// <summary> 165 /// <summary>
166 /// Enables hardware-accelerated rendering for Avalonia
167 /// </summary>
168 public bool EnableHardwareAcceleration { get; set; }
169
170 /// <summary>
166 /// Whether to hide cursor on idle, always or never 171 /// Whether to hide cursor on idle, always or never
167 /// </summary> 172 /// </summary>
168 public HideCursorMode HideCursor { get; set; } 173 public HideCursorMode HideCursor { get; set; }
diff --git a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs b/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs
index b7f36087c..2609dc9ba 100644
--- a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs
+++ b/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs
@@ -627,6 +627,11 @@ namespace Ryujinx.UI.Common.Configuration
627 public ReactiveObject<bool> ShowConfirmExit { get; private set; } 627 public ReactiveObject<bool> ShowConfirmExit { get; private set; }
628 628
629 /// <summary> 629 /// <summary>
630 /// Enables hardware-accelerated rendering for Avalonia
631 /// </summary>
632 public ReactiveObject<bool> EnableHardwareAcceleration { get; private set; }
633
634 /// <summary>
630 /// Hide Cursor on Idle 635 /// Hide Cursor on Idle
631 /// </summary> 636 /// </summary>
632 public ReactiveObject<HideCursorMode> HideCursor { get; private set; } 637 public ReactiveObject<HideCursorMode> HideCursor { get; private set; }
@@ -642,6 +647,7 @@ namespace Ryujinx.UI.Common.Configuration
642 EnableDiscordIntegration = new ReactiveObject<bool>(); 647 EnableDiscordIntegration = new ReactiveObject<bool>();
643 CheckUpdatesOnStart = new ReactiveObject<bool>(); 648 CheckUpdatesOnStart = new ReactiveObject<bool>();
644 ShowConfirmExit = new ReactiveObject<bool>(); 649 ShowConfirmExit = new ReactiveObject<bool>();
650 EnableHardwareAcceleration = new ReactiveObject<bool>();
645 HideCursor = new ReactiveObject<HideCursorMode>(); 651 HideCursor = new ReactiveObject<HideCursorMode>();
646 } 652 }
647 653
@@ -678,6 +684,7 @@ namespace Ryujinx.UI.Common.Configuration
678 EnableDiscordIntegration = EnableDiscordIntegration, 684 EnableDiscordIntegration = EnableDiscordIntegration,
679 CheckUpdatesOnStart = CheckUpdatesOnStart, 685 CheckUpdatesOnStart = CheckUpdatesOnStart,
680 ShowConfirmExit = ShowConfirmExit, 686 ShowConfirmExit = ShowConfirmExit,
687 EnableHardwareAcceleration = EnableHardwareAcceleration,
681 HideCursor = HideCursor, 688 HideCursor = HideCursor,
682 EnableVsync = Graphics.EnableVsync, 689 EnableVsync = Graphics.EnableVsync,
683 EnableShaderCache = Graphics.EnableShaderCache, 690 EnableShaderCache = Graphics.EnableShaderCache,
@@ -785,6 +792,7 @@ namespace Ryujinx.UI.Common.Configuration
785 EnableDiscordIntegration.Value = true; 792 EnableDiscordIntegration.Value = true;
786 CheckUpdatesOnStart.Value = true; 793 CheckUpdatesOnStart.Value = true;
787 ShowConfirmExit.Value = true; 794 ShowConfirmExit.Value = true;
795 EnableHardwareAcceleration.Value = true;
788 HideCursor.Value = HideCursorMode.OnIdle; 796 HideCursor.Value = HideCursorMode.OnIdle;
789 Graphics.EnableVsync.Value = true; 797 Graphics.EnableVsync.Value = true;
790 Graphics.EnableShaderCache.Value = true; 798 Graphics.EnableShaderCache.Value = true;
@@ -1442,6 +1450,15 @@ namespace Ryujinx.UI.Common.Configuration
1442 configurationFileUpdated = true; 1450 configurationFileUpdated = true;
1443 } 1451 }
1444 1452
1453 if (configurationFileFormat.Version < 50)
1454 {
1455 Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 50.");
1456
1457 configurationFileFormat.EnableHardwareAcceleration = true;
1458
1459 configurationFileUpdated = true;
1460 }
1461
1445 Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog; 1462 Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
1446 Graphics.ResScale.Value = configurationFileFormat.ResScale; 1463 Graphics.ResScale.Value = configurationFileFormat.ResScale;
1447 Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom; 1464 Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
@@ -1472,6 +1489,7 @@ namespace Ryujinx.UI.Common.Configuration
1472 EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration; 1489 EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
1473 CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart; 1490 CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
1474 ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit; 1491 ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
1492 EnableHardwareAcceleration.Value = configurationFileFormat.EnableHardwareAcceleration;
1475 HideCursor.Value = configurationFileFormat.HideCursor; 1493 HideCursor.Value = configurationFileFormat.HideCursor;
1476 Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync; 1494 Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
1477 Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache; 1495 Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
diff --git a/src/Ryujinx.UI.Common/Helper/CommandLineState.cs b/src/Ryujinx.UI.Common/Helper/CommandLineState.cs
index c3c5bd37e..6de963a74 100644
--- a/src/Ryujinx.UI.Common/Helper/CommandLineState.cs
+++ b/src/Ryujinx.UI.Common/Helper/CommandLineState.cs
@@ -8,6 +8,7 @@ namespace Ryujinx.UI.Common.Helper
8 public static string[] Arguments { get; private set; } 8 public static string[] Arguments { get; private set; }
9 9
10 public static bool? OverrideDockedMode { get; private set; } 10 public static bool? OverrideDockedMode { get; private set; }
11 public static bool? OverrideHardwareAcceleration { get; private set; }
11 public static string OverrideGraphicsBackend { get; private set; } 12 public static string OverrideGraphicsBackend { get; private set; }
12 public static string OverrideHideCursor { get; private set; } 13 public static string OverrideHideCursor { get; private set; }
13 public static string BaseDirPathArg { get; private set; } 14 public static string BaseDirPathArg { get; private set; }
@@ -87,6 +88,12 @@ namespace Ryujinx.UI.Common.Helper
87 88
88 OverrideHideCursor = args[++i]; 89 OverrideHideCursor = args[++i];
89 break; 90 break;
91 case "--software-gui":
92 OverrideHardwareAcceleration = false;
93 break;
94 case "--hardware-gui":
95 OverrideHardwareAcceleration = true;
96 break;
90 default: 97 default:
91 LaunchPathArg = arg; 98 LaunchPathArg = arg;
92 break; 99 break;
diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs
index aecc585fc..4a30aee9c 100644
--- a/src/Ryujinx/Program.cs
+++ b/src/Ryujinx/Program.cs
@@ -60,12 +60,16 @@ namespace Ryujinx.Ava
60 EnableMultiTouch = true, 60 EnableMultiTouch = true,
61 EnableIme = true, 61 EnableIme = true,
62 EnableInputFocusProxy = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP") == "gamescope", 62 EnableInputFocusProxy = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP") == "gamescope",
63 RenderingMode = new[] { X11RenderingMode.Glx, X11RenderingMode.Software }, 63 RenderingMode = ConfigurationState.Instance.EnableHardwareAcceleration ?
64 new[] { X11RenderingMode.Glx, X11RenderingMode.Software } :
65 new[] { X11RenderingMode.Software },
64 }) 66 })
65 .With(new Win32PlatformOptions 67 .With(new Win32PlatformOptions
66 { 68 {
67 WinUICompositionBackdropCornerRadius = 8.0f, 69 WinUICompositionBackdropCornerRadius = 8.0f,
68 RenderingMode = new[] { Win32RenderingMode.AngleEgl, Win32RenderingMode.Software }, 70 RenderingMode = ConfigurationState.Instance.EnableHardwareAcceleration ?
71 new[] { Win32RenderingMode.AngleEgl, Win32RenderingMode.Software } :
72 new[] { Win32RenderingMode.Software },
69 }) 73 })
70 .UseSkia(); 74 .UseSkia();
71 } 75 }
@@ -191,6 +195,12 @@ namespace Ryujinx.Ava
191 _ => ConfigurationState.Instance.HideCursor.Value, 195 _ => ConfigurationState.Instance.HideCursor.Value,
192 }; 196 };
193 } 197 }
198
199 // Check if hardware-acceleration was overridden.
200 if (CommandLineState.OverrideHardwareAcceleration != null)
201 {
202 ConfigurationState.Instance.EnableHardwareAcceleration.Value = CommandLineState.OverrideHardwareAcceleration.Value;
203 }
194 } 204 }
195 205
196 private static void PrintSystemInfo() 206 private static void PrintSystemInfo()