Bug 1250710 - ANGLE ES2 still requires HALF_FLOAT for ReadPixels, not HALF_FLOAT_OES. - r=jrmuizel draft
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 04 Jul 2016 22:57:24 -0700
changeset 383828 7e264d3d2f540722ea825dfc6eee9d68d4b3a16f
parent 383818 e90b817334db2438cbaac7ed25ece1ba0d49a138
child 524556 7129338bef5657d5b5164359abb121a9a7972565
push id22107
push userbmo:jgilbert@mozilla.com
push dateTue, 05 Jul 2016 06:00:32 +0000
reviewersjrmuizel
bugs1250710
milestone50.0a1
Bug 1250710 - ANGLE ES2 still requires HALF_FLOAT for ReadPixels, not HALF_FLOAT_OES. - r=jrmuizel MozReview-Commit-ID: JwrigS3yNTJ
dom/canvas/WebGLContextGL.cpp
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -1237,17 +1237,18 @@ WebGLContext::DoReadPixelsAndConvert(con
     if (gl->WorkAroundDriverBugs() &&
         gl->IsANGLE() &&
         gl->Version() < 300 && // ANGLE ES2 doesn't support HALF_FLOAT reads properly.
         IsNeedsANGLEWorkAround(srcFormat))
     {
         MOZ_RELEASE_ASSERT(!IsWebGL2()); // No SKIP_PIXELS, etc.
         MOZ_ASSERT(!mBoundPixelPackBuffer); // Let's be real clear.
 
-        const GLenum readType = LOCAL_GL_HALF_FLOAT_OES;
+        // You'd think ANGLE would want HALF_FLOAT_OES, but it rejects that.
+        const GLenum readType = LOCAL_GL_HALF_FLOAT;
 
         const char funcName[] = "readPixels";
         const auto readBytesPerPixel = webgl::BytesPerPixel({format, readType});
         const auto destBytesPerPixel = webgl::BytesPerPixel({format, destType});
 
         uint32_t readStride;
         uint32_t readByteCount;
         uint32_t destStride;