diff options
| author | Yong He <yonghe@outlook.com> | 2018-01-21 10:48:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-21 10:48:31 -0800 |
| commit | 4044a1d3a0605198465a7eb6e0e3c1f8b1a3c298 (patch) | |
| tree | 62927d4d2722b36c8e7eb4060e741b9032686835 /source/slang/reflection.cpp | |
| parent | 2079b941bc5849b6ab33774fb90cefe9c2d624cb (diff) | |
| parent | f681a1505c98995683a7fbae7ce208dc5e444b9b (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.cpp | 16 |
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( |
