Add D2D1InteropServices.LoadShaderBytecode overload

このコミットが含まれているのは:
Sergio Pedri committed 2022-04-24 21:03:13 +02:00
1 親 60b966cb74
コミット 5d1f3927d3
1ファイル変更
+19
+19
ファイルの表示
@@ -15,6 +15,25 @@ namespace ComputeSharp.D2D1Interop.Interop;
/// </summary>
public static unsafe class D2D1InteropServices
{
/// <summary>
/// Loads the bytecode from an input D2D1 pixel shader.
/// <para>
/// This overload can be used for simplicity when the D2D1 shader does not rely on captured objects to
/// be processed correctly. This is the case when it does not contain any <see cref="Delegate"/>-s.
/// </para>
/// </summary>
/// <typeparam name="T">The type of D2D1 pixel shader to load the bytecode for.</typeparam>
/// <param name="bytecode">A <see cref="ReadOnlyMemory{T}"/> instance with the resulting shader bytecode.</param>
/// <remarks>
/// If the input shader was precompiled, <paramref name="bytecode"/> will wrap a pinned memory buffer (from the PE section).
/// If the shader was compiled at runtime, <paramref name="bytecode"/> will wrap a <see cref="byte"/> array with the bytecode.
/// </remarks>
public static void LoadShaderBytecode<T>(out ReadOnlyMemory<byte> bytecode)
where T : unmanaged, ID2D1PixelShader
{
LoadShaderBytecode(default(T), out bytecode);
}
/// <summary>
/// Loads the bytecode from an input D2D1 pixel shader.
/// </summary>