Strip explicit interface specifier from entry points

このコミットが含まれているのは:
Sergio Pedri committed 2024-09-21 17:47:05 +02:00
1 親 057ffa1fa1
コミット 8f9134eec7
1ファイル変更
+16
+16
ファイルの表示
@@ -24,6 +24,22 @@ internal abstract class ExecuteMethodRewriter(ShaderSourceRewriter shaderSourceR
return (TNode?)base.Visit(node);
}
/// <inheritdoc/>
public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node)
{
MethodDeclarationSyntax updatedNode = ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!).WithModifiers(TokenList());
// The entry point might be an explicit interface method implementation. In that case,
// the transpiled method will have the rewritten interface name as a prefix for the
// method name, which we don't want (it's invalid HLSL). So in that case, remove it.
if (updatedNode.ExplicitInterfaceSpecifier is not null)
{
updatedNode = updatedNode.WithExplicitInterfaceSpecifier(null);
}
return updatedNode;
}
/// <inheritdoc/>
public override SyntaxNode? VisitParameterList(ParameterListSyntax node)
{