summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-09-05 22:37:34 -0700
committerGitHub <noreply@github.com>2025-09-05 22:37:34 -0700
commitbc6b82666fa4deda932c36cea93ee2059e0992b2 (patch)
tree6800fcd6839db782af056310653d35391b558c1e /source/slang/slang-check-decl.cpp
parentfe87a39e453b64e94446181a9ae5cbfc0f62bf0c (diff)
Relax restriction on using link-time types for shader parameters. (#8387)
This change relaxes a previous restriction on link-time types and constants, so that we now allow them to be used to define shader parameters. Doing so will result in a parameter layout that is incomplete prior to linking. The PR added a test to call the reflection API on a fully linked program and ensure that we can report correct binding info.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index 4711eaddd..4362f0926 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -2922,13 +2922,6 @@ void SemanticsDeclBodyVisitor::checkVarDeclCommon(VarDeclBase* varDecl)
if (auto elementType = getConstantBufferElementType(varDecl->getType()))
{
- if (doesTypeHaveTag(elementType, TypeTag::Incomplete))
- {
- getSink()->diagnose(
- varDecl->type.exp->loc,
- Diagnostics::incompleteTypeCannotBeUsedInBuffer,
- elementType);
- }
if (doesTypeHaveTag(elementType, TypeTag::Unsized))
{
// If the element type is unsized, it can only be an array of resource types that we can
@@ -2947,17 +2940,6 @@ void SemanticsDeclBodyVisitor::checkVarDeclCommon(VarDeclBase* varDecl)
}
}
}
- else if (varDecl->findModifier<HLSLUniformModifier>())
- {
- auto varType = varDecl->getType();
- if (doesTypeHaveTag(varType, TypeTag::Incomplete))
- {
- getSink()->diagnose(
- varDecl->type.exp->loc,
- Diagnostics::incompleteTypeCannotBeUsedInUniformParameter,
- varType);
- }
- }
maybeRegisterDifferentiableType(getASTBuilder(), varDecl->getType());
}