summaryrefslogtreecommitdiff
path: root/source/slang/reflection.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-01-21 10:48:31 -0800
committerGitHub <noreply@github.com>2018-01-21 10:48:31 -0800
commit4044a1d3a0605198465a7eb6e0e3c1f8b1a3c298 (patch)
tree62927d4d2722b36c8e7eb4060e741b9032686835 /source/slang/reflection.cpp
parent2079b941bc5849b6ab33774fb90cefe9c2d624cb (diff)
parentf681a1505c98995683a7fbae7ce208dc5e444b9b (diff)
Merge pull request #372 from csyonghe/master
Allow type expression as type argument, fix global param enum order
Diffstat (limited to 'source/slang/reflection.cpp')
-rw-r--r--source/slang/reflection.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/source/slang/reflection.cpp b/source/slang/reflection.cpp
index c9de75d6e..b0be58274 100644
--- a/source/slang/reflection.cpp
+++ b/source/slang/reflection.cpp
@@ -433,20 +433,8 @@ SLANG_API SlangReflectionType * spReflection_FindTypeByName(SlangReflection * re
auto context = convert(reflection);
auto compileRequest = context->targetRequest->compileRequest;
- RefPtr<Type> result;
- if (compileRequest->types.TryGetValue(name, result))
- return (SlangReflectionType*)result.Ptr();
-
- auto nameObj = compileRequest->getNamePool()->getName(name);
- Decl* resultDecl = compileRequest->lookupGlobalDecl(nameObj);
- if (resultDecl)
- {
- RefPtr<DeclRefType> declRefType = new DeclRefType();
- declRefType->declRef.decl = resultDecl;
- compileRequest->types[name] = declRefType;
- return (SlangReflectionType*)declRefType.Ptr();
- }
- return nullptr;
+ RefPtr<Type> result = compileRequest->getTypeFromString(name);
+ return (SlangReflectionType*)result.Ptr();
}
SLANG_API SlangReflectionTypeLayout* spReflection_GetTypeLayout(