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