summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-01-07 22:26:31 -0800
committerGitHub <noreply@github.com>2025-01-07 22:26:31 -0800
commitc43f6fa55aca23365c86c6ec1737d42be74d9d3e (patch)
tree2c49bc1dbd12ae5f46d682a3f240465931471060 /source/slang/slang-check-decl.cpp
parent1a56f58fdd0c704e6dc0fad0f0ec33a25a35e60b (diff)
Lower varying parameters as pointers instead of SSA values. (#5919)
* Add executable test on matrix-typed vertex input. * Fix emit logic of matrix layout qualifier. * Pass fragment shader varying input by constref to allow EvaluateAttributeAtCentroid etc. to be implemented correctly.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index ce3f1e64c..3667a36ba 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -3186,6 +3186,11 @@ void SemanticsDeclVisitorBase::checkModule(ModuleDecl* moduleDecl)
}
}
+ if (moduleDecl->findModifier<PublicModifier>())
+ {
+ moduleDecl->defaultVisibility = DeclVisibility::Public;
+ }
+
// We need/want to visit any `import` declarations before
// anything else, to make sure that scoping works.
//
@@ -12604,8 +12609,10 @@ DeclVisibility getDeclVisibility(Decl* decl)
}
auto defaultVis = DeclVisibility::Default;
if (auto parentModule = getModuleDecl(decl))
- defaultVis =
- parentModule->isInLegacyLanguage ? DeclVisibility::Public : DeclVisibility::Internal;
+ {
+ defaultVis = parentModule->isInLegacyLanguage ? DeclVisibility::Public
+ : parentModule->defaultVisibility;
+ }
// Members of other agg type decls will have their default visibility capped to the parents'.
if (as<NamespaceDecl>(decl))
@@ -12790,10 +12797,6 @@ void diagnoseCapabilityProvenance(
auto moduleDecl = getModuleDecl(declToPrint);
if (thisModule != moduleDecl)
break;
- if (moduleDecl && moduleDecl->isInLegacyLanguage)
- continue;
- if (getDeclVisibility(declToPrint) == DeclVisibility::Public)
- break;
}
if (previousDecl == declToPrint)
break;