Merge pull request #718 from Sergio0694/dev/drop-factory-target-reflection

Avoid rooting IUnknown metadata info
このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2023-12-14 19:02:18 +01:00
コミット 8c1a54768b
1ファイル変更
+7 -3
+7 -3
ファイルの表示
@@ -16,8 +16,12 @@ internal unsafe partial struct PixelShaderEffect
/// </summary>
/// <param name="effectImpl">The resulting effect factory.</param>
/// <returns>The <c>HRESULT</c> for the operation.</returns>
/// <remarks>
/// The return type is intentionally <see langword="void"/><c>*</c> because delegate targets are considered
/// visible for reflection, so not using <see cref="IUnknown"/> avoids metadata for it being rooted unnecessarily.
/// </remarks>
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate int FactoryDelegate(IUnknown** effectImpl);
public delegate int FactoryDelegate(void** effectImpl);
/// <summary>
/// A base type with global values for pixel shader effects.
@@ -153,9 +157,9 @@ internal unsafe partial struct PixelShaderEffect
}
/// <inheritdoc cref="FactoryDelegate"/>
private static int CreateEffect(IUnknown** effectImpl)
private static int CreateEffect(void** effectImpl)
{
return PixelShaderEffect.Factory(Instance, effectImpl);
return PixelShaderEffect.Factory(Instance, (IUnknown**)effectImpl);
}
}
}