Fix handling bvec on the right hand side of a logical op
The vector/matrix size matching is not done for logical ops similarly
to other binary ops. For that reason both left and right hand side
need to be checked for being scalar.
BUG=angleproject:1601
TEST=angle_unittests
Change-Id: Ie87da68d6cb0d439f0e6273d374fc7d836c82309
Reviewed-on: https://chromium-review.googlesource.com/406988
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index dd2fc4a..45fe4a5 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -3848,10 +3848,12 @@
case EOpLogicalAnd:
ASSERT(!left->isArray() && !right->isArray() && !left->getType().getStruct() &&
!right->getType().getStruct());
- if (left->getBasicType() != EbtBool || left->isMatrix() || left->isVector())
+ if (left->getBasicType() != EbtBool || !left->isScalar() || !right->isScalar())
{
return nullptr;
}
+ // Basic types matching should have been already checked.
+ ASSERT(right->getBasicType() == EbtBool);
break;
case EOpAdd:
case EOpSub: