diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp index ef8d290e85..79f68c17e2 100644 --- a/src/compiler/translator/ParseContext.cpp +++ b/src/compiler/translator/ParseContext.cpp @@ -8795,8 +8795,10 @@ bool TParseContext::binaryOpCommonCheck(TOperator op, // Samplers as l-values are disallowed also in ESSL 3.00, see section 4.1.7, // we interpret the spec so that this extends to structs containing samplers, // similarly to ESSL 1.00 spec. - if ((mShaderVersion < 300 || op == EOpAssign || op == EOpInitialize) && - left->getType().isStructureContainingSamplers()) + // ESSL 3.xx section 5.7: "[the equality operators] must also be defined for the + // [struct's] field types" — sampler equality is undefined, so struct-of-sampler + // equality is rejected in all shader versions, not only ESSL 1.00. + if (left->getType().isStructureContainingSamplers()) { error(loc, "undefined operation for structs containing samplers", GetOperatorString(op));