diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs index 135745fc..5382cafa 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs @@ -162,7 +162,8 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters return ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!) .WithBlockBody() - .WithoutAccessibilityModifiers(); + .WithoutAccessibilityModifiers() + .WithAttributeLists(List()); } /// @@ -171,6 +172,7 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters var updatedNode = ((LocalFunctionStatementSyntax)base.VisitLocalFunctionStatement(node)!) .WithBlockBody() + .WithAttributeLists(List()) .WithIdentifier(Identifier($"__{this.currentMethod!.Identifier.Text}__{node.Identifier.Text}")); // HLSL doesn't support local functions, so we first process them as usual and then remove