diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2025-03-01 05:22:58 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-28 13:22:58 -0800 |
| commit | 618b4c7657f539e66f032cd40554798bc0d68f6d (patch) | |
| tree | 1ccd5e0aad255aa8e7dd968627aaf40b42348a56 /source/slang/slang-parameter-binding.cpp | |
| parent | 66984eb856454d0a372e3b30643823af18612067 (diff) | |
Resolve 'extern' types during type layout generation if possible (#6450)
* Resolve 'extern' types during type layout generation if possible
Closes https://github.com/shader-slang/slang/issues/5994
Closes https://github.com/shader-slang/slang/issues/6437
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
| -rw-r--r-- | source/slang/slang-parameter-binding.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index 0e47ff56d..86d76fc6d 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -2382,7 +2382,14 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter( // otherwise they will include all of the above cases... else if (auto declRefType = as<DeclRefType>(type)) { + // If we are trying to get the layout of some extern type, do our best + // to look it up in other loaded modules and generate the type layout + // based on that. + declRefType = context->layoutContext.lookupExternDeclRefType(declRefType); + auto declRef = declRefType->getDeclRef(); + + if (auto structDeclRef = declRef.as<StructDecl>()) { RefPtr<StructTypeLayout> structLayout = new StructTypeLayout(); |
