diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-04 15:55:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-04 15:55:06 -0700 |
| commit | 856086cf2ac6fb1544b5b08ffa64b2f01931d35c (patch) | |
| tree | 67f521b4750c01263ce8038cfe6d771b7c3b9cfb /source/slang/slang-compiler.cpp | |
| parent | a2d90fb275962da84611160f8ddd74d934a68dbd (diff) | |
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-compiler.cpp')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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 |
