From 85967771cf094103ffa3640581fb2590d0d0be21 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 1 Dec 2020 12:23:30 +0100 Subject: [PATCH] Stripped attributes from processed methods --- .../SyntaxRewriters/ShaderSourceRewriter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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