Add D2D1PixelShader.GetInputDescriptions API

このコミットが含まれているのは:
Sergio Pedri committed 2022-05-08 18:40:26 +02:00
1 親 3b760f02d4
コミット 7a5386a55e
8ファイル変更
+68 -13

検索条件に一致するファイルはありません

+37
ファイルの表示
@@ -0,0 +1,37 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.D2D1.__Internals;
using ComputeSharp.D2D1.Interop;
using TerraFX.Interop.DirectX;
#pragma warning disable CS0618
namespace ComputeSharp.D2D1.Shaders.Loaders;
/// <summary>
/// An input descriptions loader for D2D1 pixel shaders.
/// </summary>
internal struct D2D1ByteArrayInputDescriptionsLoader : ID2D1InputDescriptionsLoader
{
/// <summary>
/// The <see cref="ID2D1DrawInfo"/> object in use.
/// </summary>
private D2D1InputDescription[]? inputDescriptions;
/// <summary>
/// Gets the resulting input descriptions.
/// </summary>
/// <remarks>A <see cref="D2D1InputDescription"/> array with the available input descriptions.</remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public D2D1InputDescription[] GetResultingInputDescriptions()
{
return this.inputDescriptions!;
}
/// <inheritdoc/>
void ID2D1InputDescriptionsLoader.LoadInputDescriptions(ReadOnlySpan<byte> data)
{
this.inputDescriptions = MemoryMarshal.Cast<byte, D2D1InputDescription>(data).ToArray();
}
}