forked from Mirror/Ryujinx
Recreate swapchain correctly when toggling VSync (#6521)
Co-authored-by: jcm <butt@butts.com>
This commit is contained in:
parent
72bdc24db8
commit
f6d24449b6
2 changed files with 8 additions and 3 deletions
|
@ -420,6 +420,12 @@ namespace Ryujinx.Ava
|
||||||
Device.Configuration.MultiplayerMode = e.NewValue;
|
Device.Configuration.MultiplayerMode = e.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToggleVSync()
|
||||||
|
{
|
||||||
|
Device.EnableDeviceVsync = !Device.EnableDeviceVsync;
|
||||||
|
_renderer.Window.ChangeVSyncMode(Device.EnableDeviceVsync);
|
||||||
|
}
|
||||||
|
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
_isActive = false;
|
_isActive = false;
|
||||||
|
@ -1068,8 +1074,7 @@ namespace Ryujinx.Ava
|
||||||
switch (currentHotkeyState)
|
switch (currentHotkeyState)
|
||||||
{
|
{
|
||||||
case KeyboardHotkeyState.ToggleVSync:
|
case KeyboardHotkeyState.ToggleVSync:
|
||||||
Device.EnableDeviceVsync = !Device.EnableDeviceVsync;
|
ToggleVSync();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case KeyboardHotkeyState.Screenshot:
|
case KeyboardHotkeyState.Screenshot:
|
||||||
ScreenshotRequested = true;
|
ScreenshotRequested = true;
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||||
|
|
||||||
private void VsyncStatus_PointerReleased(object sender, PointerReleasedEventArgs e)
|
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}");
|
Logger.Info?.Print(LogClass.Application, $"VSync toggled to: {Window.ViewModel.AppHost.Device.EnableDeviceVsync}");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue