summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-conformance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-conformance.cpp')
-rw-r--r--source/slang/slang-check-conformance.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp
index e73c0723b..d6e73e798 100644
--- a/source/slang/slang-check-conformance.cpp
+++ b/source/slang/slang-check-conformance.cpp
@@ -264,13 +264,35 @@ namespace Slang
{
if (auto arrayType = as<ArrayExpressionType>(type))
{
- return getTypeTags(arrayType->getElementType());
+ auto typeTag = getTypeTags(arrayType->getElementType());
+ bool sized = false;
+ if (auto cint = as<ConstantIntVal>(arrayType->getElementCount()))
+ {
+ if (cint->getValue() != kUnsizedArrayMagicLength)
+ {
+ sized = true;
+ }
+ }
+ else if (auto intVal = arrayType->getElementCount())
+ {
+ sized = !intVal->isLinkTimeVal();
+ }
+ if (!sized)
+ typeTag = (TypeTag)((int)typeTag | (int)TypeTag::Unsized);
+
+ return typeTag;
}
if (auto modifiedType = as<ModifiedType>(type))
{
return getTypeTags(modifiedType->getBase());
}
- if (auto declRefType = as<DeclRefType>(type))
+ if (auto parameterGroupType = as<UniformParameterGroupType>(type))
+ {
+ auto elementTags = getTypeTags(parameterGroupType->getElementType());
+ elementTags = (TypeTag)((int)elementTags & ~(int)TypeTag::Unsized);
+ return elementTags;
+ }
+ else if (auto declRefType = as<DeclRefType>(type))
{
if (auto aggTypeDecl = as<AggTypeDecl>(declRefType->getDeclRef()))
return aggTypeDecl.getDecl()->typeTags;