Bug 1368284 - Add SH_ADD_AND_TRUE_TO_LOOP_CONDITION shader compile work around for Intel drivers on MacOSX; r=jgilbert
☠☠ backed out by 2f10d697c307 ☠ ☠
authorDaosheng Mu <daoshengmu@gmail.com>
Tue, 20 Jun 2017 12:00:49 +0800
changeset 365678 dfdccf4dc6a1b1228f274fc171a606dc8210bcee
parent 365677 498a263fe058d6d05eb03cbce9667a02e868688d
child 365679 f620402d752ec587b7d228746882e6f0058eaeca
push id32080
push usercbook@mozilla.com
push dateFri, 23 Jun 2017 09:16:43 +0000
treeherdermozilla-central@3b468193c933 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1368284
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368284 - Add SH_ADD_AND_TRUE_TO_LOOP_CONDITION shader compile work around for Intel drivers on MacOSX; r=jgilbert MozReview-Commit-ID: HmSUgaBIC4g
dom/canvas/WebGLShaderValidator.cpp
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -48,16 +48,21 @@ ChooseValidatorCompileOptions(const ShBu
     if (gl->WorkAroundDriverBugs()) {
         // Work around https://bugs.webkit.org/show_bug.cgi?id=124684,
         // https://chromium.googlesource.com/angle/angle/+/5e70cf9d0b1bb
         options |= SH_UNFOLD_SHORT_CIRCUIT;
 
         // Work around that Mac drivers handle struct scopes incorrectly.
         options |= SH_REGENERATE_STRUCT_NAMES;
         options |= SH_INIT_OUTPUT_VARIABLES;
+
+        // Work around that Intel drivers on Mac OSX handle for-loop incorrectly.
+        if (gl->Vendor() == gl::GLVendor::Intel) {
+            options |= SH_ADD_AND_TRUE_TO_LOOP_CONDITION;
+        }
     }
 #endif
 
     if (gfxPrefs::WebGLAllANGLEOptions()) {
         options = -1;
 
         options ^= SH_INTERMEDIATE_TREE;
         options ^= SH_LINE_DIRECTIVES;