From 1e50368a30559245552cc8f42cb675511245b2fc Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Mon, 14 Aug 2023 13:34:27 -0700 Subject: [PATCH] Make checkbox conditional --- src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs | 13 +++++++++++-- .../UI/Views/Settings/SettingsGraphicsView.axaml | 2 +- src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs | 6 ++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs index ad6901008..ff606f331 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs @@ -25,6 +25,7 @@ using System.Net.NetworkInformation; using System.Runtime.InteropServices; using System.Threading.Tasks; using TimeZone = Ryujinx.Ava.UI.Models.TimeZone; +using Ryujinx.Graphics.OpenGL; namespace Ryujinx.Ava.UI.ViewModels { @@ -112,6 +113,8 @@ namespace Ryujinx.Ava.UI.ViewModels } } + + public bool IsOpenGLAvailable => !OperatingSystem.IsMacOS(); public bool IsHypervisorAvailable => OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64; @@ -212,11 +215,17 @@ namespace Ryujinx.Ava.UI.ViewModels _graphicsBackendIndex = value; OnPropertyChanged(); OnPropertyChanged(nameof(IsVulkanSelected)); - OnPropertyChanged(nameof(IsOGLSelected)); + OnPropertyChanged(nameof(IsSpirVAvailable)); } } - public bool IsOGLSelected => !IsVulkanSelected; + public bool SpirVCapability() + { + bool isSpirVSupported = HwCapabilitiesFacade.SupportsSpirV; + return isSpirVSupported; + } + + public bool IsSpirVAvailable => !IsVulkanSelected && SpirVCapability(); public int ScalingFilter { diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml b/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml index 36e976f54..42d29948d 100644 --- a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml +++ b/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml @@ -64,7 +64,7 @@ ToolTip.Tip="{locale:Locale ShaderCacheToggleTooltip}"> - diff --git a/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs b/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs index df12de600..5636f2713 100644 --- a/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs +++ b/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs @@ -140,4 +140,10 @@ namespace Ryujinx.Graphics.OpenGL return GL.GetError() == ErrorCode.NoError; } } + + public static class HwCapabilitiesFacade + { + public static bool SupportsSpirV => HwCapabilities.SupportsSpirV; + } + }