Commit bab4c08f by Olli Etuaho

Require size for empty array declarations

Passing dEQP tests requires this check, which seems to be a valid interpretation of ESSL3 spec section 4.1.9. BUG=angleproject:941 TEST=dEQP-GLES3.functional.shaders.arrays.invalid.* Change-Id: Iae88e6bb8e4ec784a2f1c8a94554e1e5c5e3ee85 Reviewed-on: https://chromium-review.googlesource.com/267430Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent b11e2483
......@@ -1257,9 +1257,20 @@ TIntermAggregate *TParseContext::parseSingleDeclaration(TPublicType &publicType,
{
TIntermSymbol *symbol = intermediate.addSymbol(0, identifier, TType(publicType), identifierOrTypeLocation);
mDeferredSingleDeclarationErrorCheck = (identifier == "");
bool emptyDeclaration = (identifier == "");
if (!mDeferredSingleDeclarationErrorCheck)
mDeferredSingleDeclarationErrorCheck = emptyDeclaration;
if (emptyDeclaration)
{
if (publicType.isUnsizedArray())
{
// ESSL3 spec section 4.1.9: Array declaration which leaves the size unspecified is an error.
// It is assumed that this applies to empty declarations as well.
error(identifierOrTypeLocation, "empty array declaration needs to specify a size", identifier.c_str());
}
}
else
{
if (singleDeclarationErrorCheck(publicType, identifierOrTypeLocation))
recover();
......
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