using System; using System.Runtime.CompilerServices; using ComputeSharp.D2D1.__Internals; using TerraFX.Interop.DirectX; #pragma warning disable CS0618 namespace ComputeSharp.D2D1.Shaders.Loaders; /// /// A data loader for D2D1 pixel shaders dispatched via . /// internal struct D2D1ByteArrayDispatchDataLoader : ID2D1DispatchDataLoader { /// /// The resulting array with the constant buffer to use. /// private byte[]? data; /// /// Gets the resulting pixel shader constant buffer. /// /// A array with the constant buffer for the current shader. [MethodImpl(MethodImplOptions.AggressiveInlining)] public byte[] GetResultingDispatchData() { return this.data!; } /// void ID2D1DispatchDataLoader.LoadConstantBuffer(ReadOnlySpan data) { this.data = data.ToArray(); } }