From 23cd90d4810437b7ee7e91be417308908ffc815e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 15 Sep 2023 16:31:47 +0200 Subject: [PATCH] Add D2D1PixelShaderEffect.GetEffectDisplayName() API --- .../Shaders/Interop/D2D1PixelShaderEffect.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs index 0555ba2a..c6e2bd09 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs @@ -31,6 +31,19 @@ public static unsafe class D2D1PixelShaderEffect return ref shader.EffectId; } + /// + /// Gets the effect display name of the D2D effect using this shader. + /// + /// The type of D2D1 pixel shader to get the effect id for. + /// The effect display name of the D2D effect using shaders. + public static string GetEffectDisplayName() + where T : unmanaged, ID2D1PixelShader + { + Unsafe.SkipInit(out T shader); + + return shader.EffectDisplayName; + } + /// /// Registers an effect from an input D2D1 pixel shader, by calling ID2D1Factory1::RegisterEffectFromString. /// @@ -58,7 +71,7 @@ public static unsafe class D2D1PixelShaderEffect @@ -298,7 +311,7 @@ public static unsafe class D2D1PixelShaderEffect