diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs index 008ca967..2fb5b77a 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs @@ -16,8 +16,12 @@ internal unsafe partial struct PixelShaderEffect /// /// The resulting effect factory. /// The HRESULT for the operation. + /// + /// The return type is intentionally * because delegate targets are considered + /// visible for reflection, so not using avoids metadata for it being rooted unnecessarily. + /// [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate int FactoryDelegate(IUnknown** effectImpl); + public delegate int FactoryDelegate(void** effectImpl); /// /// A base type with global values for pixel shader effects. @@ -153,9 +157,9 @@ internal unsafe partial struct PixelShaderEffect } /// - private static int CreateEffect(IUnknown** effectImpl) + private static int CreateEffect(void** effectImpl) { - return PixelShaderEffect.Factory(Instance, effectImpl); + return PixelShaderEffect.Factory(Instance, (IUnknown**)effectImpl); } } } \ No newline at end of file