From 01b32fd0ad8c6c5c28cce0f57be98e596f073401 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 17 Sep 2023 02:12:55 +0200 Subject: [PATCH] Add new metadata attributes --- .../Attributes/D2DEffectAuthorAttribute.cs | 27 +++++++++++++++++++ .../Attributes/D2DEffectCategoryAttribute.cs | 27 +++++++++++++++++++ .../D2DEffectDescriptionAttribute.cs | 27 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs create mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs create mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs new file mode 100644 index 00000000..2b0def4a --- /dev/null +++ b/src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs @@ -0,0 +1,27 @@ +using System; + +namespace ComputeSharp.D2D1; + +/// +/// An attribute for a D2D1 shader indicating the author of the shader effect to create. +/// +/// +/// This only applies to effects created from . +/// +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class D2DEffectAuthorAttribute : Attribute +{ + /// + /// Creates a new instance of the type with the specified arguments. + /// + /// The value for the author. + public D2DEffectAuthorAttribute(string value) + { + Value = value; + } + + /// + /// Gets the author value. + /// + public string Value { get; } +} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs new file mode 100644 index 00000000..bb77860d --- /dev/null +++ b/src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs @@ -0,0 +1,27 @@ +using System; + +namespace ComputeSharp.D2D1; + +/// +/// An attribute for a D2D1 shader indicating the category of the shader effect to create. +/// +/// +/// This only applies to effects created from . +/// +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class D2DEffectCategoryAttribute : Attribute +{ + /// + /// Creates a new instance of the type with the specified arguments. + /// + /// The value for the category. + public D2DEffectCategoryAttribute(string value) + { + Value = value; + } + + /// + /// Gets the category value. + /// + public string Value { get; } +} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs new file mode 100644 index 00000000..7bbb2c1d --- /dev/null +++ b/src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs @@ -0,0 +1,27 @@ +using System; + +namespace ComputeSharp.D2D1; + +/// +/// An attribute for a D2D1 shader indicating the description of the shader effect to create. +/// +/// +/// This only applies to effects created from . +/// +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class D2DEffectDescriptionAttribute : Attribute +{ + /// + /// Creates a new instance of the type with the specified arguments. + /// + /// The value for the description. + public D2DEffectDescriptionAttribute(string value) + { + Value = value; + } + + /// + /// Gets the description value. + /// + public string Value { get; } +} \ No newline at end of file