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
--- 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;
}
}