Set mUsesDiscardRewriting more conservatively
This fixes a regression from recent refactoring of unfolding short-circuiting
operators. mUsesDiscardRewriting used to be set based on detecting patterns
that the AST traverser now overwrites before the code reaches OutputHLSL. With
this patch mUsesDiscardRewriting is set more conservatively, which ensures that
using discard works correctly also in case the input shader contains the same
kind of pattern as the short-circuiting operator unfolding creates.
TEST=WebGL conformance tests on D3D9
BUG=chromium:488552
Change-Id: Iea0103822a268079593b0913f0b6fc54c745c6e3
Reviewed-on: https://chromium-review.googlesource.com/271761
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index e0d3ce1..dbdee4c 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -2320,7 +2320,7 @@
}
// ANGLE issue 486: Detect problematic conditional discard
- if (discard && FindSideEffectRewriting::search(node))
+ if (discard)
{
mUsesDiscardRewriting = true;
}