Bug 1323363 - Fix non-paranoid PBO uploads. - r=ethlin
authorJeff Gilbert <jdashg@gmail.com>
Wed, 14 Dec 2016 18:38:08 -0800
changeset 450688 9555007ca062942383043b00d266de2fabbc66f2
parent 450687 6e5513e34226316984181939c528038e80ae03b4
child 450689 013060399bd78eab379e3a4c07b3a4a55ad7aea8
push id38944
push userbmo:leftysolara@gmail.com
push dateSun, 18 Dec 2016 16:01:15 +0000
reviewersethlin
bugs1323363
milestone53.0a1
Bug 1323363 - Fix non-paranoid PBO uploads. - r=ethlin 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) {