Implemented short-circuiting for logical OR and AND operators.
TRAC #11866
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1061 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index 69634f0..33e3d18 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -1055,12 +1055,16 @@
case EOpVectorTimesMatrix: outputTriplet(visit, "mul(", ", transpose(", "))"); break;
case EOpMatrixTimesVector: outputTriplet(visit, "mul(transpose(", "), ", ")"); break;
case EOpMatrixTimesMatrix: outputTriplet(visit, "transpose(mul(transpose(", "), transpose(", ")))"); break;
- case EOpLogicalOr: outputTriplet(visit, "(", " || ", ")"); break;
+ case EOpLogicalOr:
+ out << "s" << mUnfoldSelect->getNextTemporaryIndex();
+ return false;
case EOpLogicalXor:
mUsesXor = true;
outputTriplet(visit, "xor(", ", ", ")");
break;
- case EOpLogicalAnd: outputTriplet(visit, "(", " && ", ")"); break;
+ case EOpLogicalAnd:
+ out << "s" << mUnfoldSelect->getNextTemporaryIndex();
+ return false;
default: UNREACHABLE();
}