Bug 1324940 - It's bit-shift, not byte-shift. - r=daoshengmu. a=gchang
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 20 Dec 2016 16:01:52 -0800
changeset 359178 511158eb024a1540cd0e44c8c17379621011fdd9
parent 359177 1222d083ea4703a3d2956e06509a3a07bb555e6a
child 359179 9fc3b4f4d2f111a0726e58c8aa56738dc8872449
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu, gchang
bugs1324940
milestone51.0
Bug 1324940 - It's bit-shift, not byte-shift. - r=daoshengmu. a=gchang 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;