diff --git a/src/ComputeSharp.D2D1Interop/Attributes/D2DInputComplexAttribute.cs b/src/ComputeSharp.D2D1Interop/Attributes/D2DInputComplexAttribute.cs new file mode 100644 index 00000000..b482502b --- /dev/null +++ b/src/ComputeSharp.D2D1Interop/Attributes/D2DInputComplexAttribute.cs @@ -0,0 +1,28 @@ +using System; + +namespace ComputeSharp.D2D1Interop; + +/// +/// An attribute for a D2D1 shader indicating that an input resource at a specified index uses complex sampling. +/// This attribute is optional, and not using it will cause inputs to default to complex sampling as well. +/// +/// +/// This attribute directly maps to #define D2D_INPUT<N>_COMPLEX. +/// For more info, see . +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)] +public sealed class D2DInputComplexAttribute : Attribute +{ + /// + /// Creates a new instance of the type with the specified arguments. + /// + /// The index of the resource to declare as using complex sampling. + public D2DInputComplexAttribute(int index) + { + Index = index; + } + + /// + /// Gets the index of the resource declared as using complex sampling. + /// + public int Index { get; } +} diff --git a/src/ComputeSharp.D2D1Interop/Attributes/D2DInputCountAttribute.cs b/src/ComputeSharp.D2D1Interop/Attributes/D2DInputCountAttribute.cs new file mode 100644 index 00000000..e0648a41 --- /dev/null +++ b/src/ComputeSharp.D2D1Interop/Attributes/D2DInputCountAttribute.cs @@ -0,0 +1,28 @@ +using System; + +namespace ComputeSharp.D2D1Interop; + +/// +/// An attribute for a D2D1 shader indicating the number of texture inputs for the shader. +/// Using this attribute is mandatory when defining a D2D1 shader. +/// +/// +/// This attribute directly maps to #define D2D_INPUT_COUNT <N>. +/// For more info, see . +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class D2DInputCountAttribute : Attribute +{ + /// + /// Creates a new instance of the type with the specified arguments. + /// + /// The number of texture inputs for the shader. + public D2DInputCountAttribute(int count) + { + Count = count; + } + + /// + /// Gets the number of texture inputs for the shader. + /// + public int Count { get; } +} diff --git a/src/ComputeSharp.D2D1Interop/Attributes/D2DInputSimpleAttribute.cs b/src/ComputeSharp.D2D1Interop/Attributes/D2DInputSimpleAttribute.cs new file mode 100644 index 00000000..2f201fcf --- /dev/null +++ b/src/ComputeSharp.D2D1Interop/Attributes/D2DInputSimpleAttribute.cs @@ -0,0 +1,28 @@ +using System; + +namespace ComputeSharp.D2D1Interop; + +/// +/// An attribute for a D2D1 shader indicating that an input resource at a specified index uses simple +/// sampling. This attribute is optional, and not using it will cause inputs to default to complex sampling. +/// +/// +/// This attribute directly maps to #define D2D_INPUT<N>_SIMPLE. +/// For more info, see . +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)] +public sealed class D2DInputSimpleAttribute : Attribute +{ + /// + /// Creates a new instance of the type with the specified arguments. + /// + /// The index of the resource to declare as using simple sampling. + public D2DInputSimpleAttribute(int index) + { + Index = index; + } + + /// + /// Gets the index of the resource declared as using simple sampling. + /// + public int Index { get; } +} diff --git a/src/ComputeSharp.D2D1Interop/Attributes/D2DRequiresScenePositionAttribute.cs b/src/ComputeSharp.D2D1Interop/Attributes/D2DRequiresScenePositionAttribute.cs new file mode 100644 index 00000000..bc57cc65 --- /dev/null +++ b/src/ComputeSharp.D2D1Interop/Attributes/D2DRequiresScenePositionAttribute.cs @@ -0,0 +1,16 @@ +using System; + +namespace ComputeSharp.D2D1Interop; + +/// +/// An attribute for a D2D1 shader indicating that the shader function calls helper methods that use the scene position +/// value (that is, ). This parameter should only be included when necessary, since +/// only one function per linked shader can utilize this parameter. Defining this value is optional. +/// +/// +/// This attribute directly maps to #define D2D_REQUIRES_SCENE_POSITION. +/// For more info, see . +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class D2DRequiresScenePositionAttribute : Attribute +{ +}