summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-08 16:10:27 -0800
committerGitHub <noreply@github.com>2023-12-08 16:10:27 -0800
commit12fcffaaaf2d1ffa2eefa680e2d7c9971e38a5db (patch)
treefab26218d438d6d6057eab2d3548a72561c18fae /source/slang/slang-lower-to-ir.cpp
parent4321929879c1ed5b87ff95a99ca7da91e28d18fd (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.cpp5
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>())