From 228a4006a6b64e9ca3e2465ceef355884e0b65b6 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 15 Oct 2023 21:15:51 +0200 Subject: [PATCH] Add [GeneratedComputeShaderDescriptor] type --- ...neratedComputeShaderDescriptorAttribute.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/ComputeSharp/Core/Attributes/GeneratedComputeShaderDescriptorAttribute.cs diff --git a/src/ComputeSharp/Core/Attributes/GeneratedComputeShaderDescriptorAttribute.cs b/src/ComputeSharp/Core/Attributes/GeneratedComputeShaderDescriptorAttribute.cs new file mode 100644 index 00000000..f92c1fe2 --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/GeneratedComputeShaderDescriptorAttribute.cs @@ -0,0 +1,27 @@ +using System; + +namespace ComputeSharp; + +/// +/// An attribute that indicates that a given compute shader should have its associated descriptor code being generated. +/// +/// This attribute can be used on shader types that are declared as : +/// +/// [GeneratedComputeShaderDescriptor] +/// partial struct MyShader : IComputeShader +/// { +/// } +/// +/// +/// +/// The shader type must implement either or . +/// +/// +/// When a shader is annotated with , the source generator will also add +/// to its implemented interfaces, and implement its APIs automatically. +/// +/// +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class GeneratedComputeShaderDescriptorAttribute : Attribute +{ +} \ No newline at end of file