From 0b53b418eb398f339a62b253e113b4c0047bc2ce Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Mon, 5 Feb 2024 12:51:45 -0800 Subject: [PATCH] Automatically switch to SPIR-V if Vulkan is selected --- .../UI/ViewModels/SettingsViewModel.cs | 28 +++++++++++++++---- .../Views/Settings/SettingsGraphicsView.axaml | 5 ++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs index f1de0e9c1..abd03fb78 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs @@ -164,7 +164,7 @@ namespace Ryujinx.Ava.UI.ViewModels public bool IsScalingFilterActive => _scalingFilter == (int)Ryujinx.Common.Configuration.ScalingFilter.Fsr; public bool IsVulkanSelected => GraphicsBackendIndex == 0; - public bool IsSpirVSelected => ShadingLangugeIndex == 0; + public bool IsOGSpirVAvialble => true; public bool UseHypervisor { get; set; } @@ -200,7 +200,8 @@ namespace Ryujinx.Ava.UI.ViewModels _graphicsBackendIndex = value; OnPropertyChanged(); OnPropertyChanged(nameof(IsVulkanSelected)); - OnPropertyChanged(nameof(IsOpenGLSelected)); + NoGLSLVulkan(); + OnPropertyChanged(nameof(ShadingLangugeIndex)); } } @@ -211,13 +212,9 @@ namespace Ryujinx.Ava.UI.ViewModels { _shadinglanguageBackendIndex = value; OnPropertyChanged(); - OnPropertyChanged(nameof(IsOpenGLSelected)); } } - - public bool IsOpenGLSelected => !IsVulkanSelected; - public int ScalingFilter { get => _scalingFilter; @@ -334,6 +331,16 @@ namespace Ryujinx.Ava.UI.ViewModels }); } + public async Task NoGLSLVulkan() + { + if (IsVulkanSelected & ShadingLangugeIndex == 1 || IsVulkanSelected & _shadinglanguageBackendIndex == 1) + { + _shadinglanguageBackendIndex = 0; + ShadingLangugeIndex = 0; + } + } + + private async Task LoadAvailableGpus() { AvailableGpus.Clear(); @@ -409,6 +416,15 @@ namespace Ryujinx.Ava.UI.ViewModels Dispatcher.UIThread.Post(() => OnPropertyChanged(nameof(NetworkInterfaceIndex))); } + private async Task NoGLSLVUlkan() + { + if (_graphicsBackendIndex == 0) + { + _shadinglanguageBackendIndex = 0; + } + + } + public void ValidateAndSetTimeZone(string location) { if (_validTzRegions.Contains(location)) diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml b/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml index ae2edd9c7..40d8a081d 100644 --- a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml +++ b/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml @@ -64,11 +64,12 @@ + SelectedIndex="{Binding ShadingLangugeIndex}" + AutoScrollToSelectedItem="True"> - +