diff options
| author | Yong He <yonghe@outlook.com> | 2022-02-09 15:30:38 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-09 15:30:38 -0800 |
| commit | b8982fcf43b86c1e39dcc3dd19bff2821633eda6 (patch) | |
| tree | 0d66dbf46b50e760cce4aee232bd6a020976e6fb /source/slang/slang-reflection-api.cpp | |
| parent | 59f3fdc0a372d19ce4e989514ee3e9ecbcbf234c (diff) | |
Various fixes to gfx. (#2120)
* Various fixes to gfx.
* Fix.
* Fixes.
* Fix.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index 17ceb6842..714dc292f 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -728,6 +728,8 @@ SLANG_API SlangReflectionType * spReflection_FindTypeByName(SlangReflection * re try { Type* result = program->getTypeFromString(name, &sink); + if (as<ErrorType>(result)) + return nullptr; return (SlangReflectionType*)result; } catch( ... ) @@ -2567,6 +2569,19 @@ SLANG_API char const* spReflectionEntryPoint_getName( return entryPointLayout ? getCstr(entryPointLayout->name) : nullptr; } +SLANG_API char const* spReflectionEntryPoint_getNameOverride(SlangReflectionEntryPoint* inEntryPoint) +{ + auto entryPointLayout = convert(inEntryPoint); + if (entryPointLayout) + { + if (entryPointLayout->nameOverride.getLength()) + return entryPointLayout->nameOverride.getBuffer(); + else + return getCstr(entryPointLayout->name); + } + return nullptr; +} + SLANG_API unsigned spReflectionEntryPoint_getParameterCount( SlangReflectionEntryPoint* inEntryPoint) { |
