From 856086cf2ac6fb1544b5b08ffa64b2f01931d35c Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 4 Aug 2023 15:55:06 -0700 Subject: Add option to use original entrypoint in spirv output. (#3047) * Add option to use original entrypoint in spirv output. * Fix. --------- Co-authored-by: Yong He --- source/slang/slang-compiler.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-compiler.cpp') diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 4e1ab8e98..12e96d7bb 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -1222,11 +1222,18 @@ namespace Slang auto entryPoint = getEntryPoint(entryPointIndex); profile = getEffectiveProfile(entryPoint, targetReq); - options.entryPointName = allocator.allocate(getText(entryPoint->getName())); - auto entryPointNameOverride = getProgram()->getEntryPointNameOverride(entryPointIndex); - if (entryPointNameOverride.getLength() != 0) + if (getTargetReq()->getHLSLToVulkanLayoutOptions() && !getTargetReq()->getHLSLToVulkanLayoutOptions()->getUseOriginalEntryPointName()) { - options.entryPointName = allocator.allocate(entryPointNameOverride); + } + else + { + + options.entryPointName = allocator.allocate(getText(entryPoint->getName())); + auto entryPointNameOverride = getProgram()->getEntryPointNameOverride(entryPointIndex); + if (entryPointNameOverride.getLength() != 0) + { + options.entryPointName = allocator.allocate(entryPointNameOverride); + } } } else -- cgit v1.2.3