diff --git a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs b/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs index 0200e78c..41fc5c75 100644 --- a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs +++ b/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs @@ -59,8 +59,8 @@ partial class D3DCompiler lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(OpenWrapper); lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(CloseWrapper); #else - lpVtbl[0] = (delegate* unmanaged)&Open; - lpVtbl[1] = (delegate* unmanaged)&Close; + lpVtbl[0] = (delegate* unmanaged[MemberFunction])&Open; + lpVtbl[1] = (delegate* unmanaged[MemberFunction])&Close; #endif return lpVtbl; @@ -90,7 +90,9 @@ partial class D3DCompiler } /// - [UnmanagedCallersOnly] +#if !SOURCE_GENERATOR + [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] +#endif public static int Open(ID3DIncludeForD2DHelpers* @this, D3D_INCLUDE_TYPE IncludeType, sbyte* pFileName, void* pParentData, void** ppData, uint* pBytes) { #if SOURCE_GENERATOR @@ -109,7 +111,9 @@ partial class D3DCompiler } /// - [UnmanagedCallersOnly] +#if !SOURCE_GENERATOR + [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] +#endif public static int Close(ID3DIncludeForD2DHelpers* @this, void* pData) { return S_OK;