Commit fb6ab2ce by Olli Etuaho

Matrix layout qualifiers are valid for non-matrices

Uniform block members may be structs containing matrices, and there's no explicit mention in the spec that the matrix qualifiers would only be valid for matrix fields. Only generate a warning when an extraneous matrix layout qualifier is used. TEST=dEQP-GLES3.functional.shaders.*layout* (all pass with this patch) BUG=angleproject:1058 Change-Id: Ifb2f2392d84100d997cc2d68fd55e9ad17a17cea Reviewed-on: https://chromium-review.googlesource.com/284112Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent cb8ff7fb
......@@ -2235,11 +2235,10 @@ TIntermAggregate *TParseContext::addInterfaceBlock(const TPublicType &typeQualif
{
fieldLayoutQualifier.matrixPacking = blockLayoutQualifier.matrixPacking;
}
else if (!fieldType->isMatrix())
else if (!fieldType->isMatrix() && fieldType->getBasicType() != EbtStruct)
{
error(field->line(), "invalid layout qualifier:",
getMatrixPackingString(fieldLayoutQualifier.matrixPacking), "can only be used on matrix types");
recover();
warning(field->line(), "extraneous layout qualifier:",
getMatrixPackingString(fieldLayoutQualifier.matrixPacking), "only has an effect on matrix types");
}
fieldType->setLayoutQualifier(fieldLayoutQualifier);
......
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