Added forward declarations for shader methods
Fixes https://github.com/Sergio0694/ComputeSharp/issues/117
このコミットが含まれているのは:
1 親
979b89dba2
コミット
003a322912
8ファイル変更
+118
-16
検索条件に一致するファイルはありません
@@ -126,6 +126,22 @@ namespace ComputeSharp.SourceGenerators.Extensions
|
||||
return node;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="MethodDeclarationSyntax"/> as a method definition.
|
||||
/// </summary>
|
||||
/// <param name="node">The input <see cref="MethodDeclarationSyntax"/> node.</param>
|
||||
/// <returns>A node like the one in input, but just as a definition.</returns>
|
||||
[Pure]
|
||||
public static MethodDeclarationSyntax AsDefinition(this MethodDeclarationSyntax node)
|
||||
{
|
||||
if (node.ExpressionBody is ArrowExpressionClauseSyntax)
|
||||
{
|
||||
return node.WithExpressionBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken));
|
||||
}
|
||||
|
||||
return node.WithBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="LocalFunctionStatementSyntax"/> with a block body.
|
||||
/// </summary>
|
||||
@@ -155,6 +171,22 @@ namespace ComputeSharp.SourceGenerators.Extensions
|
||||
return node;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="LocalFunctionStatementSyntax"/> as a method definition.
|
||||
/// </summary>
|
||||
/// <param name="node">The input <see cref="LocalFunctionStatementSyntax"/> node.</param>
|
||||
/// <returns>A node like the one in input, but just as a definition.</returns>
|
||||
[Pure]
|
||||
public static LocalFunctionStatementSyntax AsDefinition(this LocalFunctionStatementSyntax node)
|
||||
{
|
||||
if (node.ExpressionBody is ArrowExpressionClauseSyntax)
|
||||
{
|
||||
return node.WithExpressionBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken));
|
||||
}
|
||||
|
||||
return node.WithBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="MethodDeclarationSyntax"/> instance with no accessibility modifiers.
|
||||
/// </summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする