From e03fc738cd804c41e7e1c52c5951d98844a62cd0 Mon Sep 17 00:00:00 2001 From: _Neo_ Date: Wed, 9 Sep 2026 21:21:21 -0500 Subject: [PATCH] Refactor GetIcdPath --- src/Ryujinx.Graphics.Vulkan/VulkanDriver.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/VulkanDriver.cs b/src/Ryujinx.Graphics.Vulkan/VulkanDriver.cs index 551f5bc9c..778d4b95f 100644 --- a/src/Ryujinx.Graphics.Vulkan/VulkanDriver.cs +++ b/src/Ryujinx.Graphics.Vulkan/VulkanDriver.cs @@ -9,20 +9,27 @@ namespace Ryujinx.Graphics.Vulkan { private static string GetIcdPath(string fileName) { - string contentsDir = Path.GetDirectoryName(AppContext.BaseDirectory.TrimEnd('/'))!; + string baseDir = AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + string contentsDir = Path.GetDirectoryName(baseDir)!; string[] searchPaths = [ + // .app bundle: Path.Combine(contentsDir, "Resources", "vulkan", "icd.d", fileName), + + // Local build: Path.Combine(contentsDir, fileName) ]; foreach (string icdPath in searchPaths) { if (File.Exists(icdPath)) + { return icdPath; + } } - throw new FileNotFoundException($"{fileName} not found"); + throw new FileNotFoundException( + $"{fileName} not found. Searched:\n{string.Join(Environment.NewLine, searchPaths)}"); } public static void MoltenVK()