SPV: Fix #904: Correctly check for built-in block redeclations for location check.

This commit is contained in:
John Kessenich 2017-05-24 23:10:28 -06:00
parent 84cc15f0d0
commit 7c9129bcb7
2 changed files with 14 additions and 6 deletions

View file

@ -4343,7 +4343,9 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
switch (qualifier.storage) {
case EvqVaryingIn:
case EvqVaryingOut:
if (type.getBasicType() != EbtBlock || !(*type.getStruct())[0].type->getQualifier().hasLocation())
if (type.getBasicType() != EbtBlock ||
(!(*type.getStruct())[0].type->getQualifier().hasLocation() &&
(*type.getStruct())[0].type->getQualifier().builtIn == EbvNone))
error(loc, "SPIR-V requires location for user input/output", "location", "");
break;
default: