Bug 1289655 - Use UINT32_MAX for drawArrays because of OSX. - r=mtseng
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 29 Jul 2016 13:05:56 -0700
changeset 307617 33a6f68fdddd9d597b93e69e2abde15b48a24f2e
parent 307616 72904d652e9a5e74bf6b7833f22e54ad005fe752
child 307618 00ec649c5c61c1c494cc59efa86d86a15dac030e
push id30516
push usercbook@mozilla.com
push dateTue, 02 Aug 2016 15:10:10 +0000
treeherdermozilla-central@f299890191b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtseng
bugs1289655
milestone50.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 1289655 - Use UINT32_MAX for drawArrays because of OSX. - r=mtseng MozReview-Commit-ID: 8bB4DHGQRnB
dom/canvas/WebGLContextDraw.cpp
--- a/dom/canvas/WebGLContextDraw.cpp
+++ b/dom/canvas/WebGLContextDraw.cpp
@@ -255,20 +255,21 @@ WebGLContext::DrawArrays_check(GLint fir
     }
 
     if (!ValidateStencilParamsForDrawCall()) {
         return false;
     }
 
     if (IsWebGL2() && !gl->IsSupported(gl::GLFeature::prim_restart_fixed)) {
         MOZ_ASSERT(gl->IsSupported(gl::GLFeature::prim_restart));
-        if (mPrimRestartTypeBytes) {
-            mPrimRestartTypeBytes = 0;
+        if (mPrimRestartTypeBytes != 4) {
+            mPrimRestartTypeBytes = 4;
 
-            gl->fPrimitiveRestartIndex(0);
+            // OSX has issues leaving this as 0.
+            gl->fPrimitiveRestartIndex(UINT32_MAX);
         }
     }
 
     // If count is 0, there's nothing to do.
     if (count == 0 || primcount == 0) {
         return false;
     }