diff --git a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs index 89392f6b..d260b6fc 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs @@ -311,7 +311,7 @@ namespace Ryujinx.Ava.UI.ViewModels { _gpuIds = new List(); List names = new(); - var devices = VulkanRenderer.GetPhysicalDevices(Vk.GetApi()); + var devices = VulkanRenderer.GetPhysicalDevices(); if (devices.Length == 0) { diff --git a/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs b/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs index ffa1a103..74267325 100644 --- a/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs +++ b/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs @@ -599,6 +599,25 @@ namespace Ryujinx.Graphics.Vulkan return new HardwareInfo(GpuVendor, GpuRenderer); } + /// + /// Gets the available Vulkan devices using the default Vulkan API + /// object returned by + /// + /// + public static DeviceInfo[] GetPhysicalDevices() + { + try + { + return VulkanInitialization.GetSuitablePhysicalDevices(Vk.GetApi()); + } + catch (Exception ex) + { + Logger.Error?.PrintMsg(LogClass.Gpu, $"Error querying Vulkan devices: {ex.Message}"); + + return Array.Empty(); + } + } + public static DeviceInfo[] GetPhysicalDevices(Vk api) { try diff --git a/src/Ryujinx/Ui/Windows/SettingsWindow.cs b/src/Ryujinx/Ui/Windows/SettingsWindow.cs index 65175ff1..fbfbf527 100644 --- a/src/Ryujinx/Ui/Windows/SettingsWindow.cs +++ b/src/Ryujinx/Ui/Windows/SettingsWindow.cs @@ -478,7 +478,7 @@ namespace Ryujinx.Ui.Windows if (Enum.Parse(_graphicsBackend.ActiveId) == GraphicsBackend.Vulkan) { - var devices = VulkanRenderer.GetPhysicalDevices(Vk.GetApi()); + var devices = VulkanRenderer.GetPhysicalDevices(); string preferredGpuIdFromConfig = ConfigurationState.Instance.Graphics.PreferredGpu.Value; string preferredGpuId = preferredGpuIdFromConfig; bool noGpuId = string.IsNullOrEmpty(preferredGpuIdFromConfig);