From 9df9c57a6768ea06763041bb6cc6546b7979ec89 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 9 Aug 2022 12:41:54 +0200 Subject: [PATCH] Move NeedsD2DRequiresScenePositionAttribute down --- .../SyntaxRewriters/HlslSourceRewriter.cs | 5 ----- .../SyntaxRewriters/ShaderSourceRewriter.cs | 5 +++++ .../SyntaxRewriters/StaticFieldRewriter.cs | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs index 7f85ac19..01dbe00c 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs @@ -65,11 +65,6 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter Diagnostics = diagnostics; } - /// - /// Gets whether or not the shader needs the [D2DRequiresScenePosition] attribute. - /// - public bool NeedsD2DRequiresScenePositionAttribute { get; protected set; } - /// public override SyntaxNode VisitCastExpression(CastExpressionSyntax node) { diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs index 44c8e47f..99cad0f2 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs @@ -96,6 +96,11 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter /// public IReadOnlyDictionary LocalFunctions => this.localFunctions; + /// + /// Gets whether or not the shader needs the [D2DRequiresScenePosition] attribute. + /// + public bool NeedsD2DRequiresScenePositionAttribute { get; private set; } + /// public MethodDeclarationSyntax? Visit(MethodDeclarationSyntax? node) { diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs index a238b6f6..16ca9bd5 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs @@ -35,6 +35,9 @@ internal sealed class StaticFieldRewriter : HlslSourceRewriter { } + /// + public bool NeedsD2DRequiresScenePositionAttribute { get; private set; } + /// public ExpressionSyntax? Visit(VariableDeclaratorSyntax? node) {