From bcf5302dd48668048848230ff11add27e6d78115 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 3 Feb 2025 22:21:29 -0800 Subject: Auto enable `-fvk-use-entrypoint-name` when there is more than one entrypoint. (#6260) * Auto enable `-fvk-use-entrypoint-name` when there is more than one entrypoint. * Fix. --- source/slang/slang-ir-glsl-legalize.cpp | 3 ++- source/slang/slang-parser.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/slang/slang-ir-glsl-legalize.cpp b/source/slang/slang-ir-glsl-legalize.cpp index 04fb54924..3ca441f96 100644 --- a/source/slang/slang-ir-glsl-legalize.cpp +++ b/source/slang/slang-ir-glsl-legalize.cpp @@ -3722,7 +3722,8 @@ void legalizeEntryPointForGLSL( // Rename the entrypoint to "main" to conform to GLSL standard, // if the compile options require us to do it. - if (!shouldUseOriginalEntryPointName(codeGenContext)) + if (!shouldUseOriginalEntryPointName(codeGenContext) && + codeGenContext->getEntryPointCount() == 1) { entryPointDecor->setName(builder.getStringValue(UnownedStringSlice("main"))); } diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 4a9d0a576..0d7281e3f 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -2352,6 +2352,7 @@ static Expr* tryParseGenericApp(Parser* parser, Expr* base) case TokenType::OpEql: case TokenType::OpNeq: case TokenType::OpGreater: + case TokenType::OpRsh: case TokenType::EndOfFile: { return parseGenericApp(parser, base); -- cgit v1.2.3