From 8c7f464876842d546216ef5894dbde2399e626f3 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 14 Sep 2023 22:58:32 +0200 Subject: [PATCH] Add D2DEffectDisplayNameAttribute type --- .../D2DEffectDisplayNameAttribute.cs | 27 +++++++++++++++++++ .../Attributes/D2DEffectIdAttribute.cs | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs new file mode 100644 index 00000000..5b68b638 --- /dev/null +++ b/src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs @@ -0,0 +1,27 @@ +using System; + +namespace ComputeSharp.D2D1; + +/// +/// An attribute for a D2D1 shader indicating the display name of the shader effect to create. +/// +/// +/// This only applies to effects created from . +/// +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class D2DEffectDisplayNameAttribute : Attribute +{ + /// + /// Creates a new instance of the type with the specified arguments. + /// + /// The value for the display name. + public D2DEffectDisplayNameAttribute(string value) + { + Value = value; + } + + /// + /// Gets the display name value. + /// + public string Value { get; } +} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs index 07f3556d..c64e8bb8 100644 --- a/src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs +++ b/src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs @@ -21,7 +21,7 @@ public sealed class D2DEffectIdAttribute : Attribute } /// - /// Gets the number of texture inputs for the shader. + /// Gets the effect id value. /// public Guid Value { get; } } \ No newline at end of file