Properly report error when layout qualifiers are specified outside uniform blocks.
TRAC #23357
Signed-off-by: Shannon Woods
Signed-off-by: Geoff Lang
Authored-by: Jamie Madill
diff --git a/src/compiler/ParseHelper.cpp b/src/compiler/ParseHelper.cpp
index 25106ec..a30bd27 100644
--- a/src/compiler/ParseHelper.cpp
+++ b/src/compiler/ParseHelper.cpp
@@ -976,18 +976,18 @@
if (layoutQualifier.matrixPacking != EmpUnspecified)
{
error(identifierLocation, "layout qualifier", getMatrixPackingString(layoutQualifier.matrixPacking), "only valid for interface blocks");
- return false;
+ return true;
}
if (layoutQualifier.blockStorage != EbsUnspecified)
{
error(identifierLocation, "layout qualifier", getBlockStorageString(layoutQualifier.blockStorage), "only valid for interface blocks");
- return false;
+ return true;
}
if (publicType.qualifier != EvqVertexInput && publicType.qualifier != EvqFragmentOutput && layoutLocationErrorCheck(identifierLocation, publicType.layoutQualifier))
{
- return false;
+ return true;
}
return false;
@@ -1226,7 +1226,7 @@
if (identifier != "")
{
- if (structQualifierErrorCheck(identifierLocation, publicType))
+ if (singleDeclarationErrorCheck(publicType, identifierLocation, identifier))
recover();
// this error check can mutate the type
@@ -1249,7 +1249,7 @@
TIntermAggregate* TParseContext::parseSingleArrayDeclaration(TPublicType &publicType, TSourceLoc identifierLocation, const TString &identifier, TSourceLoc indexLocation, TIntermTyped *indexExpression)
{
- if (structQualifierErrorCheck(identifierLocation, publicType))
+ if (singleDeclarationErrorCheck(publicType, identifierLocation, identifier))
recover();
// this error check can mutate the type