aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjcm <john.moody@coloradocollege.edu>2024-03-26 20:54:13 -0500
committerGitHub <noreply@github.com>2024-03-26 22:54:13 -0300
commitf6d24449b6e1ebe753c0a8095a435820c0948f19 (patch)
treed5383677f92b1b0d746d25c73872b26a2ec21038 /src
parent72bdc24db8047b015490182b6156c67b31f88669 (diff)
Recreate swapchain correctly when toggling VSync (#6521)
Co-authored-by: jcm <butt@butts.com>
Diffstat (limited to 'src')
-rw-r--r--src/Ryujinx/AppHost.cs9
-rw-r--r--src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs
index 2620ea68..868d194f 100644
--- a/src/Ryujinx/AppHost.cs
+++ b/src/Ryujinx/AppHost.cs
@@ -420,6 +420,12 @@ namespace Ryujinx.Ava
Device.Configuration.MultiplayerMode = e.NewValue;
}
+ public void ToggleVSync()
+ {
+ Device.EnableDeviceVsync = !Device.EnableDeviceVsync;
+ _renderer.Window.ChangeVSyncMode(Device.EnableDeviceVsync);
+ }
+
public void Stop()
{
_isActive = false;
@@ -1068,8 +1074,7 @@ namespace Ryujinx.Ava
switch (currentHotkeyState)
{
case KeyboardHotkeyState.ToggleVSync:
- Device.EnableDeviceVsync = !Device.EnableDeviceVsync;
-
+ ToggleVSync();
break;
case KeyboardHotkeyState.Screenshot:
ScreenshotRequested = true;
diff --git a/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs
index 239a7cbf..52849571 100644
--- a/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs
+++ b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs
@@ -33,7 +33,7 @@ namespace Ryujinx.Ava.UI.Views.Main
private void VsyncStatus_PointerReleased(object sender, PointerReleasedEventArgs e)
{
- Window.ViewModel.AppHost.Device.EnableDeviceVsync = !Window.ViewModel.AppHost.Device.EnableDeviceVsync;
+ Window.ViewModel.AppHost.ToggleVSync();
Logger.Info?.Print(LogClass.Application, $"VSync toggled to: {Window.ViewModel.AppHost.Device.EnableDeviceVsync}");
}