Clean up RecordConstantPrecision interaction with switch/case
There were two bugs here that were masking each other:
1. Case nodes were not being added to AST traversal path.
2. RecordConstantPrecision did not check if a constant was a child of
a case node.
Fix these.
BUG=angleproject:1490
TEST=WebGL 2 conformance tests
Change-Id: Ic6cb7942bf57870fa26eb6a011919a2d7951cc85
Reviewed-on: https://chromium-review.googlesource.com/394588
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/IntermTraverse.cpp b/src/compiler/translator/IntermTraverse.cpp
index 189a422..89a9a52 100644
--- a/src/compiler/translator/IntermTraverse.cpp
+++ b/src/compiler/translator/IntermTraverse.cpp
@@ -680,7 +680,11 @@
visit = visitCase(PreVisit, node);
if (visit && node->getCondition())
+ {
+ incrementDepth(node);
node->getCondition()->traverse(this);
+ decrementDepth();
+ }
if (visit && postVisit)
visitCase(PostVisit, node);