diff options
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index 8ec0979e4..07857c293 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -432,7 +432,11 @@ SLANG_API unsigned int spReflectionType_GetFieldCount(SlangReflectionType* inTyp auto declRef = declRefType->declRef; if( auto structDeclRef = declRef.as<StructDecl>()) { - return (unsigned int)getFields(structDeclRef, MemberFilterStyle::Instance).getCount(); + return (unsigned int)getFields( + getModule(declRef.decl)->getLinkage()->getASTBuilder(), + structDeclRef, + MemberFilterStyle::Instance) + .getCount(); } } @@ -451,7 +455,8 @@ SLANG_API SlangReflectionVariable* spReflectionType_GetFieldByIndex(SlangReflect auto declRef = declRefType->declRef; if( auto structDeclRef = declRef.as<StructDecl>()) { - auto fields = getFields(structDeclRef, MemberFilterStyle::Instance); + auto fields = getFields( + getModule(declRef)->getLinkage()->getASTBuilder(), structDeclRef, MemberFilterStyle::Instance); auto fieldDeclRef = fields[index]; return (SlangReflectionVariable*) fieldDeclRef.getDecl(); } |
