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) ...@@ -1450,7 +1450,10 @@ void TParseContext::parseGlobalLayoutQualifier(const TPublicType &typeQualifier)
defaultMatrixPacking = layoutQualifier.matrixPacking; defaultMatrixPacking = layoutQualifier.matrixPacking;
} }
// TODO: block storage if (layoutQualifier.blockStorage != EmpUnspecified)
{
defaultBlockStorage = layoutQualifier.blockStorage;
}
} }
TFunction *TParseContext::addConstructorFunc(TPublicType publicType) TFunction *TParseContext::addConstructorFunc(TPublicType publicType)
...@@ -1915,6 +1918,11 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif ...@@ -1915,6 +1918,11 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif
blockLayoutQualifier.matrixPacking = defaultMatrixPacking; blockLayoutQualifier.matrixPacking = defaultMatrixPacking;
} }
if (blockLayoutQualifier.blockStorage == EbsUnspecified)
{
blockLayoutQualifier.blockStorage = defaultBlockStorage;
}
TSymbol* blockNameSymbol = new TInterfaceBlockName(&blockName); TSymbol* blockNameSymbol = new TInterfaceBlockName(&blockName);
if (!symbolTable.declare(*blockNameSymbol)) { if (!symbolTable.declare(*blockNameSymbol)) {
error(nameLine, "redefinition", blockName.c_str(), "interface block name"); error(nameLine, "redefinition", blockName.c_str(), "interface block name");
...@@ -1949,6 +1957,12 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif ...@@ -1949,6 +1957,12 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif
recover(); recover();
} }
if (memberLayoutQualifier.blockStorage != EbsUnspecified)
{
error(memberTypeLine.line, "invalid layout qualifier:", getBlockStorageString(memberLayoutQualifier.blockStorage), "cannot be used here");
recover();
}
if (memberLayoutQualifier.matrixPacking == EmpUnspecified) if (memberLayoutQualifier.matrixPacking == EmpUnspecified)
{ {
memberLayoutQualifier.matrixPacking = blockLayoutQualifier.matrixPacking; memberLayoutQualifier.matrixPacking = blockLayoutQualifier.matrixPacking;
......
...@@ -39,6 +39,7 @@ struct TParseContext { ...@@ -39,6 +39,7 @@ struct TParseContext {
functionReturnsValue(false), functionReturnsValue(false),
checksPrecisionErrors(checksPrecErrors), checksPrecisionErrors(checksPrecErrors),
defaultMatrixPacking(EmpColumnMajor), defaultMatrixPacking(EmpColumnMajor),
defaultBlockStorage(EbsShared),
diagnostics(is), diagnostics(is),
shaderVersion(100), shaderVersion(100),
directiveHandler(ext, diagnostics, shaderVersion), directiveHandler(ext, diagnostics, shaderVersion),
...@@ -59,6 +60,7 @@ struct TParseContext { ...@@ -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 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. bool fragmentPrecisionHigh; // true if highp precision is supported in the fragment language.
TLayoutMatrixPacking defaultMatrixPacking; TLayoutMatrixPacking defaultMatrixPacking;
TLayoutBlockStorage defaultBlockStorage;
TString HashErrMsg; TString HashErrMsg;
TDiagnostics diagnostics; TDiagnostics diagnostics;
TDirectiveHandler directiveHandler; 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