mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-22 02:31:12 +02:00
Refactor GetIcdPath
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user