mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-03 07:08:53 +02:00
- Mesa 26.0 introduced KosmicKrisp, a Vulkan-on-Metal translation layer and the eventual successor to MoltenVK
35 lines
912 B
C#
35 lines
912 B
C#
using Silk.NET.Core.Contexts;
|
|
using Silk.NET.Vulkan;
|
|
using SPB.Graphics.Vulkan;
|
|
|
|
namespace Ryujinx.Graphics.Vulkan
|
|
{
|
|
public static class VulkanSpbApi
|
|
{
|
|
public static Vk GetApiFromSpb()
|
|
{
|
|
LamdaNativeContext baseCtx = new(VulkanHelper.GetProcAddress);
|
|
MultiNativeContext ctx = new(baseCtx, null);
|
|
Vk ret = new(ctx);
|
|
|
|
ctx.Contexts[1] = new LamdaNativeContext(x =>
|
|
{
|
|
if (x.EndsWith("ProcAddr"))
|
|
{
|
|
return default;
|
|
}
|
|
|
|
nint ptr = ret.GetDeviceProcAddr(ret.CurrentDevice.GetValueOrDefault(), x);
|
|
if (ptr != default)
|
|
{
|
|
return ptr;
|
|
}
|
|
|
|
return ret.GetInstanceProcAddr(ret.CurrentInstance.GetValueOrDefault(), x);
|
|
});
|
|
|
|
return ret;
|
|
}
|
|
}
|
|
}
|