File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System . Runtime . InteropServices ;
12using Silk . NET . Core . Loader ;
23
34namespace Silk . NET . Vulkan ;
@@ -35,9 +36,14 @@ private class NativeContext : INativeContext
3536
3637 public unsafe void * LoadFunction ( string functionName , string libraryNameHint )
3738 {
38- if ( functionName . EndsWith ( "ProcAddr" ) )
39+ if ( functionName == "vkGetDeviceProcAddr" )
3940 {
40- return null ;
41+ return ( delegate * unmanaged< DeviceHandle , sbyte * , void * > ) & GetDeviceProcAddr ;
42+ }
43+
44+ if ( functionName == "vkGetInstanceProcAddr" )
45+ {
46+ return ( delegate * unmanaged< InstanceHandle , sbyte * , void * > ) & GetInstanceProcAddr ;
4147 }
4248
4349 void * ptr = Ivk . GetDeviceProcAddr ( Vk . CurrentDevice . GetValueOrDefault ( ) , functionName ) ;
@@ -50,6 +56,18 @@ private class NativeContext : INativeContext
5056 return ptr ;
5157 }
5258
59+ [ UnmanagedCallersOnly ]
60+ private static unsafe void * GetDeviceProcAddr ( DeviceHandle device , sbyte * pName )
61+ {
62+ return DllImport . GetDeviceProcAddr ( device , pName ) ;
63+ }
64+
65+ [ UnmanagedCallersOnly ]
66+ private static unsafe void * GetInstanceProcAddr ( InstanceHandle instance , sbyte * pName )
67+ {
68+ return DllImport . GetInstanceProcAddr ( instance , pName ) ;
69+ }
70+
5371 public void Dispose ( ) { }
5472 }
5573}
You can’t perform that action at this time.
0 commit comments