diff --git a/src/ComputeSharp.Core/Attributes/Internals/AutoConstructorBehavior.cs b/src/ComputeSharp.Core/Attributes/Internals/AutoConstructorBehavior.cs new file mode 100644 index 00000000..0690f9f7 --- /dev/null +++ b/src/ComputeSharp.Core/Attributes/Internals/AutoConstructorBehavior.cs @@ -0,0 +1,12 @@ +namespace ComputeSharp; + +/// +/// Indicates the behavior of fields annotated with . +/// +internal enum AutoConstructorBehavior +{ + /// + /// Causes to ignore fields and set their values to . + /// + IgnoreAndSetToDefault +} diff --git a/src/ComputeSharp.Core/Attributes/Internals/AutoConstructorBehaviorAttribute.cs b/src/ComputeSharp.Core/Attributes/Internals/AutoConstructorBehaviorAttribute.cs new file mode 100644 index 00000000..35d32d62 --- /dev/null +++ b/src/ComputeSharp.Core/Attributes/Internals/AutoConstructorBehaviorAttribute.cs @@ -0,0 +1,24 @@ +using System; + +namespace ComputeSharp; + +/// +/// An attribute that indicates that a target shader type should get an automatic constructor for all fields. +/// +[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] +internal sealed class AutoConstructorBehaviorAttribute : Attribute +{ + /// + /// Creates a new instance with the specified parameters. + /// + /// The value for the current instance. + public AutoConstructorBehaviorAttribute(AutoConstructorBehavior behavior) + { + Behavior = behavior; + } + + /// + /// Gets the value for the current instance. + /// + public AutoConstructorBehavior Behavior { get; } +} \ No newline at end of file