From 36b4e4c0cfa8a4f20c4aaf0f77648e91ecb36e2a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 2 Apr 2022 15:14:35 +0200 Subject: [PATCH] Minor API tweaks --- .../Interfaces/ID2D1PixelShader.cs | 7 +++---- .../Shaders/Interop/InteropServices.cs | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ComputeSharp.D2D1Interop/Interfaces/ID2D1PixelShader.cs b/src/ComputeSharp.D2D1Interop/Interfaces/ID2D1PixelShader.cs index eba1c46b..3c7207f5 100644 --- a/src/ComputeSharp.D2D1Interop/Interfaces/ID2D1PixelShader.cs +++ b/src/ComputeSharp.D2D1Interop/Interfaces/ID2D1PixelShader.cs @@ -5,14 +5,13 @@ namespace ComputeSharp.D2D1Interop; /// -/// An representing a pixel shader. +/// An representing a D2D1 pixel shader. /// -public interface IPixelShader : ID2D1Shader - where TPixel : unmanaged +public interface ID2D1PixelShader : ID2D1Shader { /// /// Executes the current pixel shader. /// /// The pixel value for the current invocation. - TPixel Execute(); + Float4 Execute(); } \ No newline at end of file diff --git a/src/ComputeSharp.D2D1Interop/Shaders/Interop/InteropServices.cs b/src/ComputeSharp.D2D1Interop/Shaders/Interop/InteropServices.cs index a93dfcc8..7b289a70 100644 --- a/src/ComputeSharp.D2D1Interop/Shaders/Interop/InteropServices.cs +++ b/src/ComputeSharp.D2D1Interop/Shaders/Interop/InteropServices.cs @@ -27,7 +27,7 @@ public static class InteropServices /// If the shader was compiled at runtime, will wrap a array with the bytecode. /// public static unsafe void LoadShaderBytecode(in T shader, out ReadOnlyMemory bytecode) - where T : struct, ID2D1Shader + where T : unmanaged, ID2D1PixelShader { D2D1ShaderBytecodeLoader bytecodeLoader = default; @@ -56,7 +56,7 @@ public static class InteropServices /// A pointer to the ID2D1DrawInfo instance to use. /// For more info, see . public static unsafe void SetPixelShaderConstantBufferForD2D1DrawInfo(in T shader, void* d2D1DrawInfo) - where T : struct, ID2D1Shader + where T : unmanaged, ID2D1PixelShader { D2D1DrawInfoDispatchDataLoader dataLoader = new((ID2D1DrawInfo*)d2D1DrawInfo);