summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-conformance.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-01-15 20:43:01 -0800
committerGitHub <noreply@github.com>2025-01-15 20:43:01 -0800
commit387f2be1e48a805ef0da34510a5ae0ebc0ba9c3e (patch)
tree8769f2b809fae510cfab39ff430063978ec3abb3 /source/slang/slang-check-conformance.cpp
parent6db69eae7ecfb5111a48723d3f3c4104c7da880a (diff)
Inline global constants that contains opaque handles for legalization. (#6098)
* Inline global constants that contains opaque handles for legalization. * Add diagnostics on opaque type global variables. * Fix. * Fix test.
Diffstat (limited to 'source/slang/slang-check-conformance.cpp')
-rw-r--r--source/slang/slang-check-conformance.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp
index 499b409ea..71b87f447 100644
--- a/source/slang/slang-check-conformance.cpp
+++ b/source/slang/slang-check-conformance.cpp
@@ -347,9 +347,16 @@ TypeTag SemanticsVisitor::getTypeTags(Type* type)
if (auto parameterGroupType = as<UniformParameterGroupType>(type))
{
auto elementTags = getTypeTags(parameterGroupType->getElementType());
- elementTags = (TypeTag)((int)elementTags & ~(int)TypeTag::Unsized);
+ elementTags = (TypeTag)(((int)elementTags & ~(int)TypeTag::Unsized) | (int)TypeTag::Opaque);
return elementTags;
}
+ else if (
+ as<UntypedBufferResourceType>(type) || as<ResourceType>(type) ||
+ as<SamplerStateType>(type) || as<HLSLStructuredBufferTypeBase>(type) ||
+ as<DynamicResourceType>(type))
+ {
+ return TypeTag::Opaque;
+ }
else if (auto declRefType = as<DeclRefType>(type))
{
if (auto aggTypeDecl = as<AggTypeDecl>(declRefType->getDeclRef()))