Add an option to unfold short circuiting in AST.
We replace "a || b" with "a ? true : b",
"a && b" with "a ? b : false".
This is to work around short circuiting bug in Mac drivers.
ANGLEBUG=482
TEST=webgl conformance tests
R=alokp@chromium.org, kbr@chromium.org
Review URL: https://codereview.appspot.com/14529048
Conflicts:
src/build_angle.gypi
src/compiler/translator/Compiler.cpp
Change-Id: Ic2384a97d58f54294efcb3a012deb2007a9fc658
Reviewed-on: https://chromium-review.googlesource.com/178996
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/src/compiler/translator/IntermTraverse.cpp b/src/compiler/translator/IntermTraverse.cpp
index 0e345d2..a579488 100644
--- a/src/compiler/translator/IntermTraverse.cpp
+++ b/src/compiler/translator/IntermTraverse.cpp
@@ -51,7 +51,7 @@
//
if (visit)
{
- it->incrementDepth();
+ it->incrementDepth(this);
if (it->rightToLeft)
{
@@ -98,7 +98,7 @@
visit = it->visitUnary(PreVisit, this);
if (visit) {
- it->incrementDepth();
+ it->incrementDepth(this);
operand->traverse(it);
it->decrementDepth();
}
@@ -119,7 +119,7 @@
if (visit)
{
- it->incrementDepth();
+ it->incrementDepth(this);
if (it->rightToLeft)
{
@@ -166,7 +166,7 @@
visit = it->visitSelection(PreVisit, this);
if (visit) {
- it->incrementDepth();
+ it->incrementDepth(this);
if (it->rightToLeft) {
if (falseBlock)
falseBlock->traverse(it);
@@ -199,7 +199,7 @@
if (visit)
{
- it->incrementDepth();
+ it->incrementDepth(this);
if (it->rightToLeft)
{
@@ -248,7 +248,7 @@
visit = it->visitBranch(PreVisit, this);
if (visit && expression) {
- it->incrementDepth();
+ it->incrementDepth(this);
expression->traverse(it);
it->decrementDepth();
}