Bug 1324940 - It's bit-shift, not byte-shift. - r=daoshengmu draft
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 20 Dec 2016 16:01:52 -0800
changeset 451775 a9b8a9956aa9215824a0e2f1c9298195c5e9436e
parent 451656 7083c0d30e75fc102c715887af9faec933e936f8
child 540127 ddc8fc31385c1783c5523c40d1820e38f851a772
push id39291
push userbmo:jgilbert@mozilla.com
push dateWed, 21 Dec 2016 00:02:15 +0000
reviewersdaoshengmu
bugs1324940
milestone53.0a1
Bug 1324940 - It's bit-shift, not byte-shift. - r=daoshengmu MozReview-Commit-ID: BfmjmTu32Zc
dom/canvas/WebGLContextDraw.cpp
--- a/dom/canvas/WebGLContextDraw.cpp
+++ b/dom/canvas/WebGLContextDraw.cpp
@@ -624,17 +624,17 @@ WebGLContext::DrawElements_check(const c
 
     ////
 
     if (IsWebGL2() && !gl->IsSupported(gl::GLFeature::prim_restart_fixed)) {
         MOZ_ASSERT(gl->IsSupported(gl::GLFeature::prim_restart));
         if (mPrimRestartTypeBytes != bytesPerElem) {
             mPrimRestartTypeBytes = bytesPerElem;
 
-            const uint32_t ones = UINT32_MAX >> (4 - mPrimRestartTypeBytes);
+            const uint32_t ones = UINT32_MAX >> (32 - 8*mPrimRestartTypeBytes);
             gl->fEnable(LOCAL_GL_PRIMITIVE_RESTART);
             gl->fPrimitiveRestartIndex(ones);
         }
     }
 
     ////
 
     const GLsizei first = byteOffset / bytesPerElem;