Commit 1566ef70 by Jamie Madill Committed by Shannon Woods

Add parsing for default block storage qualifiers.

Also add in a missing layout qualifier error check. TRAC #23083 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent b4e664b1
......@@ -1450,7 +1450,10 @@ void TParseContext::parseGlobalLayoutQualifier(const TPublicType &typeQualifier)
defaultMatrixPacking = layoutQualifier.matrixPacking;
}
// TODO: block storage
if (layoutQualifier.blockStorage != EmpUnspecified)
{
defaultBlockStorage = layoutQualifier.blockStorage;
}
}
TFunction *TParseContext::addConstructorFunc(TPublicType publicType)
......@@ -1915,6 +1918,11 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif
blockLayoutQualifier.matrixPacking = defaultMatrixPacking;
}
if (blockLayoutQualifier.blockStorage == EbsUnspecified)
{
blockLayoutQualifier.blockStorage = defaultBlockStorage;
}
TSymbol* blockNameSymbol = new TInterfaceBlockName(&blockName);
if (!symbolTable.declare(*blockNameSymbol)) {
error(nameLine, "redefinition", blockName.c_str(), "interface block name");
......@@ -1949,6 +1957,12 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif
recover();
}
if (memberLayoutQualifier.blockStorage != EbsUnspecified)
{
error(memberTypeLine.line, "invalid layout qualifier:", getBlockStorageString(memberLayoutQualifier.blockStorage), "cannot be used here");
recover();
}
if (memberLayoutQualifier.matrixPacking == EmpUnspecified)
{
memberLayoutQualifier.matrixPacking = blockLayoutQualifier.matrixPacking;
......
......@@ -39,6 +39,7 @@ struct TParseContext {
functionReturnsValue(false),
checksPrecisionErrors(checksPrecErrors),
defaultMatrixPacking(EmpColumnMajor),
defaultBlockStorage(EbsShared),
diagnostics(is),
shaderVersion(100),
directiveHandler(ext, diagnostics, shaderVersion),
......@@ -59,6 +60,7 @@ struct TParseContext {
bool checksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit.
bool fragmentPrecisionHigh; // true if highp precision is supported in the fragment language.
TLayoutMatrixPacking defaultMatrixPacking;
TLayoutBlockStorage defaultBlockStorage;
TString HashErrMsg;
TDiagnostics diagnostics;
TDirectiveHandler directiveHandler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment