Cleanup
This commit is contained in:
parent
d62644e464
commit
63515c9b6c
2 changed files with 14 additions and 13 deletions
|
@ -9,6 +9,8 @@ namespace Ryujinx.Graphics.Vulkan.MoltenVK
|
|||
[SupportedOSPlatform("macos")]
|
||||
public static partial class MVKInitialization
|
||||
{
|
||||
private const string VulkanLib = "libvulkan.dylib";
|
||||
|
||||
[LibraryImport("libMoltenVK.dylib")]
|
||||
private static partial Result vkGetMoltenVKConfigurationMVK(IntPtr unusedInstance, out MVKConfiguration config, in IntPtr configSize);
|
||||
|
||||
|
@ -31,20 +33,19 @@ namespace Ryujinx.Graphics.Vulkan.MoltenVK
|
|||
vkSetMoltenVKConfigurationMVK(IntPtr.Zero, config, configSize);
|
||||
}
|
||||
|
||||
private static string[] Resolver(string path)
|
||||
{
|
||||
if (path.EndsWith(VulkanLib))
|
||||
{
|
||||
path = path[..^VulkanLib.Length] + "libMoltenVK.dylib";
|
||||
return [path];
|
||||
}
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
|
||||
public static void InitializeResolver()
|
||||
{
|
||||
Func<string, string[]> mvkResolver = (string path) =>
|
||||
{
|
||||
if (path.EndsWith("libvulkan.dylib"))
|
||||
{
|
||||
path = path.Substring(0, path.Length - "libvulkan.dylib".Length) + "libMoltenVK.dylib";
|
||||
return [ path ];
|
||||
}
|
||||
|
||||
return Array.Empty<string>();
|
||||
};
|
||||
|
||||
((DefaultPathResolver)PathResolver.Default).Resolvers.Insert(0, mvkResolver);
|
||||
((DefaultPathResolver)PathResolver.Default).Resolvers.Insert(0, Resolver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using CommandLine;
|
||||
using CommandLine;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using Ryujinx.Audio.Backends.SDL2;
|
||||
using Ryujinx.Common;
|
||||
|
|
Loading…
Add table
Reference in a new issue