Bug 1323363 - Fix non-paranoid PBO uploads. - r=ethlin a=gchang
authorJeff Gilbert <jdashg@gmail.com>
Wed, 14 Dec 2016 18:38:08 -0800
changeset 359146 7b34556d03c76449d325efd3540bd3302f999d57
parent 359145 904a33bad7c498d81cc369d565ffa5b00ed3ee92
child 359147 9e8e044f7b789162871ac104e5aac881b81a88a3
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)
reviewersethlin, gchang
bugs1323363
milestone51.0
Bug 1323363 - Fix non-paranoid PBO uploads. - r=ethlin a=gchang MozReview-Commit-ID: L0nCELNAmBc
dom/canvas/TexUnpackBlob.cpp
--- a/dom/canvas/TexUnpackBlob.cpp
+++ b/dom/canvas/TexUnpackBlob.cpp
@@ -402,18 +402,27 @@ TexUnpackBytes::TexOrSubImage(bool isSub
                                funcName);
 
         if (gl->WorkAroundDriverBugs()) {
             useParanoidHandling |= (gl->Vendor() == gl::GLVendor::NVIDIA);
         }
     }
 
     if (!useParanoidHandling) {
+        if (webgl->mBoundPixelUnpackBuffer) {
+            gl->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER,
+                            webgl->mBoundPixelUnpackBuffer->mGLName);
+        }
+
         *out_error = DoTexOrSubImage(isSubImage, gl, target, level, dui, xOffset, yOffset,
                                      zOffset, mWidth, mHeight, mDepth, uploadPtr);
+
+        if (webgl->mBoundPixelUnpackBuffer) {
+            gl->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, 0);
+        }
         return true;
     }
 
     //////
 
     MOZ_ASSERT(webgl->mBoundPixelUnpackBuffer);
 
     if (!isSubImage) {