From b8982fcf43b86c1e39dcc3dd19bff2821633eda6 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 9 Feb 2022 15:30:38 -0800 Subject: Various fixes to gfx. (#2120) * Various fixes to gfx. * Fix. * Fixes. * Fix. Co-authored-by: Yong He --- source/slang/slang-reflection-api.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/slang/slang-reflection-api.cpp') 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(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) { -- cgit v1.2.3