Fix ValidateLimitations for folded non-constant expressions
ANGLE recently gained the ability to constant fold some expressions that
are not constant expressions. ValidateLimitations should continue to
recognize all cases where an expression is not a constant expression.
BUG=angleproject:851
TEST=angle_unittests
Change-Id: I8ad0552a59213cdd6af9a220ffd672be9752271d
Reviewed-on: https://chromium-review.googlesource.com/317281
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
diff --git a/src/compiler/translator/ValidateLimitations.cpp b/src/compiler/translator/ValidateLimitations.cpp
index ed60c37..4a84fb6 100644
--- a/src/compiler/translator/ValidateLimitations.cpp
+++ b/src/compiler/translator/ValidateLimitations.cpp
@@ -433,8 +433,8 @@
bool ValidateLimitations::isConstExpr(TIntermNode *node)
{
- ASSERT(node != NULL);
- return node->getAsConstantUnion() != NULL;
+ ASSERT(node != nullptr);
+ return node->getAsConstantUnion() != nullptr && node->getAsTyped()->getQualifier() == EvqConst;
}
bool ValidateLimitations::isConstIndexExpr(TIntermNode *node)