diff options
| author | Yong He <yonghe@outlook.com> | 2023-12-08 16:10:27 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-08 16:10:27 -0800 |
| commit | 12fcffaaaf2d1ffa2eefa680e2d7c9971e38a5db (patch) | |
| tree | fab26218d438d6d6057eab2d3548a72561c18fae /source/slang/slang-lower-to-ir.cpp | |
| parent | 4321929879c1ed5b87ff95a99ca7da91e28d18fd (diff) | |
Handle import, entrypoint and global params in included files. (#3395)
* Handle `import`, entrypoint and global params in included files.
* Fix language server.
* Extend `_createScopeForLegacyLookup` for `__include`.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 8f94b7e90..f0fd33e13 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -7304,6 +7304,11 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> // Variable declared at global/namespace scope? -> Global. return true; } + else if (as<FileDecl>(parent)) + { + // Variable declared at file scope? -> Global. + return true; + } else if(as<AggTypeDeclBase>(parent)) { if(decl->hasModifier<HLSLStaticModifier>()) |
