Bug 1399501 - Part3: Exclude SH_UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX flag on Mac to prevent conformance testfails r?jgilbert draft
authorChih-Yi Leu <subsevenx2001@gmail.com>
Mon, 18 Sep 2017 13:47:41 +0800
changeset 666180 aa4ad29e7b9261a2837cc379500d4b625862e95a
parent 666179 dce8cdffba723f49b3219bb334a73706d875a07c
child 666181 66e2e4c20b8de55a4b70cfd00380375f33075709
push id80298
push userbmo:cleu@mozilla.com
push dateMon, 18 Sep 2017 05:53:31 +0000
reviewersjgilbert
bugs1399501
milestone57.0a1
Bug 1399501 - Part3: Exclude SH_UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX flag on Mac to prevent conformance testfails r?jgilbert MozReview-Commit-ID: EMV6k0zTdlN
dom/canvas/WebGLShaderValidator.cpp
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -32,23 +32,24 @@ static ShCompileOptions
 ChooseValidatorCompileOptions(const ShBuiltInResources& resources,
                               const mozilla::gl::GLContext* gl)
 {
     ShCompileOptions options = SH_VARIABLES |
                                SH_ENFORCE_PACKING_RESTRICTIONS |
                                SH_OBJECT_CODE |
                                SH_INIT_GL_POSITION;
 
+#ifndef XP_MACOSX
     // Sampler arrays indexed with non-constant expressions are forbidden in
     // GLSL 1.30 and later.
     // ESSL 3 requires constant-integral-expressions for this as well.
-    // Just do it universally.
+    // We exclude this flag on Mac to prevent some mac-specific
+    // conformance testfails.
     options |= SH_UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX;
 
-#ifndef XP_MACOSX
     // We want to do this everywhere, but to do this on Mac, we need
     // to do it only on Mac OSX > 10.6 as this causes the shader
     // compiler in 10.6 to crash
     options |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
 #endif
 
     if (gl->WorkAroundDriverBugs()) {
 #ifdef XP_MACOSX