diff --git a/src/ComputeSharp.D2D1/Attributes/D2DResourceIndexAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DResourceIndexAttribute.cs
new file mode 100644
index 00000000..07fd076e
--- /dev/null
+++ b/src/ComputeSharp.D2D1/Attributes/D2DResourceIndexAttribute.cs
@@ -0,0 +1,28 @@
+using System;
+
+namespace ComputeSharp.D2D1;
+
+///
+/// An attribute for a field in a D2D1 shader indicating the index of the D2D1 resource.
+/// This is needed to bind an input resource in a shader to the correct input. Using this attribute is mandatory.
+///
+///
+/// For more info, see .
+///
+[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
+public sealed class D2DResourceIndexAttribute : Attribute
+{
+ ///
+ /// Creates a new instance of the type with the specified arguments.
+ ///
+ /// The index of the annotated field.
+ public D2DResourceIndexAttribute(int index)
+ {
+ Index = index;
+ }
+
+ ///
+ /// Gets the index of the annotated field.
+ ///
+ public int Index { get; }
+}