Fix bug in StructType::GetElementType().

We were only resolving unbound variability for the top-level type,
which isn't enough if we have e.g. an unbound-variability pointer
pointing to some type with unbound variability.
This commit is contained in:
Matt Pharr
2012-02-29 14:25:58 -08:00
parent 55b81e35a7
commit 4b9c3ec0da

View File

@@ -2094,12 +2094,8 @@ StructType::GetElementType(int i) const {
// If the element has unbound variability, resolve its variability to
// the struct type's variability
if (ret->HasUnboundVariability()) {
if (variability == Varying)
ret = ret->GetAsVaryingType();
else
ret = ret->GetAsUniformType();
}
ret = ret->ResolveUnboundVariability(variability);
return isConst ? ret->GetAsConstType() : ret;
}