Issue an error if "uniform" or "varying" qualifiers are applied to void types.

Issue #179.
This commit is contained in:
Matt Pharr
2012-02-21 12:26:42 -08:00
parent 95224f3f11
commit 8603f9838f
7 changed files with 69 additions and 17 deletions

View File

@@ -69,12 +69,21 @@ lApplyTypeQualifiers(int typeQualifiers, const Type *type, SourcePos pos) {
if ((typeQualifiers & TYPEQUAL_CONST) != 0)
type = type->GetAsConstType();
if ((typeQualifiers & TYPEQUAL_UNIFORM) != 0)
type = type->GetAsUniformType();
else if ((typeQualifiers & TYPEQUAL_VARYING) != 0)
type = type->GetAsVaryingType();
if ((typeQualifiers & TYPEQUAL_UNIFORM) != 0) {
if (type == AtomicType::Void)
Error(pos, "\"uniform\" qualifier is illegal with \"void\" type.");
else
type = type->GetAsUniformType();
}
else if ((typeQualifiers & TYPEQUAL_VARYING) != 0) {
if (type == AtomicType::Void)
Error(pos, "\"varying\" qualifier is illegal with \"void\" type.");
else
type = type->GetAsVaryingType();
}
else
type = type->GetAsUnboundVariabilityType();
if (type != AtomicType::Void)
type = type->GetAsUnboundVariabilityType();
if ((typeQualifiers & TYPEQUAL_UNSIGNED) != 0) {
if ((typeQualifiers & TYPEQUAL_SIGNED) != 0)