diff options
author | Zhenyao Mo <zmo@chromium.org> | 2013-10-15 12:59:30 -0700 |
---|---|---|
committer | Shannon Woods <shannonwoods@chromium.org> | 2013-12-09 21:51:57 +0000 |
commit | 7cab38b594213c7c80f70871b72d40d30e878035 (patch) | |
tree | 909abcd7914ce664f426ad1715078e8b4f29c1c9 /include | |
parent | 6cb95f3a235c20dbe4bb9f5de75401a16014c012 (diff) | |
download | angle-7cab38b594213c7c80f70871b72d40d30e878035.tar.gz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/GLSLANG/ShaderLang.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/GLSLANG/ShaderLang.h b/include/GLSLANG/ShaderLang.h index f6a348f9..1ff84dce 100644 --- a/include/GLSLANG/ShaderLang.h +++ b/include/GLSLANG/ShaderLang.h @@ -217,6 +217,13 @@ typedef enum { // fragment shader. It is intended as a workaround for drivers which // incorrectly fail to link programs if gl_Position is not written. SH_INIT_GL_POSITION = 0x8000, + + // This flag replaces + // "a && b" with "a ? b : false", + // "a || b" with "a ? true : b". + // This is to work around a MacOSX driver bug that |b| is executed + // independent of |a|'s value. + SH_UNFOLD_SHORT_CIRCUIT = 0x10000, } ShCompileOptions; // Defines alternate strategies for implementing array index clamping. |