Bug 1368284 - Add SH_ADD_AND_TRUE_TO_LOOP_CONDITION shader compile work around for Intel drivers on MacOSX; r?jgilbert draft
authorDaosheng Mu <daoshengmu@gmail.com>
Mon, 26 Jun 2017 08:39:30 -0700
changeset 600415 6c1bac2e6a8300842e8438d29921064beab6cbca
parent 600414 da4ac701aae7e6c070af65dc8f07cec22c1598d5
child 634982 5504bfa4a096020ad955c5caf97807c79f5ce0d4
push id65749
push userbmo:dmu@mozilla.com
push dateMon, 26 Jun 2017 15:45:07 +0000
reviewersjgilbert
bugs1368284
milestone56.0a1
Bug 1368284 - Add SH_ADD_AND_TRUE_TO_LOOP_CONDITION shader compile work around for Intel drivers on MacOSX; r?jgilbert MozReview-Commit-ID: JMHuZirH4L5
dom/canvas/WebGLShaderValidator.cpp
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -48,16 +48,21 @@ ChooseValidatorCompileOptions(const ShBu
 #ifdef XP_MACOSX
         // 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 (!gl->IsANGLE() && gl->Vendor() == gl::GLVendor::Intel) {
             // Failures on at least Windows+Intel+OGL on:
             // conformance/glsl/constructors/glsl-construct-mat2.html
             options |= SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS;
         }
     }