diff options
| author | Yong He <yonghe@outlook.com> | 2022-01-21 12:13:23 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-21 12:13:23 -0800 |
| commit | 7cff340b10b27f82781335093759bbdc19cd2865 (patch) | |
| tree | 15a983c4fdfb68b700ab532d5d2a684e8727e6b4 /source/slang/slang-compiler.cpp | |
| parent | f85bc7ae98486b37518958e659f659f1ff9b125c (diff) | |
Add entry-point name override feature. (#2089)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-compiler.cpp')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index c1a768f02..d90e9b102 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -282,6 +282,14 @@ namespace Slang return m_mangledName; } + String EntryPoint::getEntryPointNameOverride(Index index) + { + SLANG_UNUSED(index); + SLANG_ASSERT(index == 0); + + return m_nameOverride; + } + void EntryPoint::acceptVisitor(ComponentTypeVisitor* visitor, SpecializationInfo* specializationInfo) { visitor->visitEntryPoint(this, as<EntryPointSpecializationInfo>(specializationInfo)); @@ -1211,7 +1219,11 @@ namespace Slang // Set the entry point name options.entryPointName = getText(entryPoint->getName()); - + auto entryPointNameOverride = program->getEntryPointNameOverride(entryPointIndex); + if (entryPointNameOverride.getLength() != 0) + { + options.entryPointName = entryPointNameOverride; + } if (compilerType == PassThroughMode::Dxc) { // We will enable the flag to generate proper code for 16 - bit types |
