Bug 1305864 - Catch INVALID_OP from bad-format CopyTexSubImage in ANGLE for now. - r=daoshengmu. a=gchang
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 19 Dec 2016 17:53:52 -0800
changeset 353129 882a3059bd47062f8272eaf6f7699e4cf97b1b36
parent 353128 4cd2b1eaa3d3d55e3fa0f3b6b4d16b5949aae80c
child 353130 617286d6483d74081fdb9fc001bed23b002a1ffe
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu, gchang
bugs1305864
milestone52.0a2
Bug 1305864 - Catch INVALID_OP from bad-format CopyTexSubImage in ANGLE for now. - r=daoshengmu. a=gchang MozReview-Commit-ID: 9Hq0pW4xwRN
dom/canvas/WebGLTextureUpload.cpp
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -2004,16 +2004,23 @@ DoCopyTexOrSubImage(WebGLContext* webgl,
         return true;
     } while (false);
 
     if (error == LOCAL_GL_OUT_OF_MEMORY) {
         webgl->ErrorOutOfMemory("%s: Ran out of memory during texture copy.", funcName);
         return false;
     }
 
+    if (gl->IsANGLE() && error == LOCAL_GL_INVALID_OPERATION) {
+        webgl->ErrorImplementationBug("%s: ANGLE is particular about CopyTexSubImage"
+                                      " formats matching exactly.",
+                                      funcName);
+        return false;
+    }
+
     MOZ_RELEASE_ASSERT(false, "GFX: We should have caught all other errors.");
     webgl->GenerateWarning("%s: Unexpected error during texture copy. Context lost.",
                            funcName);
     webgl->ForceLoseContext();
     return false;
 }
 
 // There is no CopyTexImage3D.