Bug 1090518 - Fix crash during webgl-depth-texture.html conformance test. r=jrmuizel, a=sledru
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Mon, 08 Dec 2014 11:36:19 -0500
changeset 242832 36535f9806e6
parent 242831 b07f9144d190
child 242833 3b4908a629e8
push id4319
push userryanvm@gmail.com
push date2015-01-14 14:36 +0000
treeherdermozilla-beta@f6d5f2303fea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1090518
milestone36.0
Bug 1090518 - Fix crash during webgl-depth-texture.html conformance test. r=jrmuizel, a=sledru The crash happens because we get a GL error back from glTexImage2D when we try to glTexImage2D a depth texture in EnsureNoUnitializedImageData. Uploading glTexImage2D is not supported with the ANGLE_depth_texture extension. We need to use the framebuffer path.
dom/canvas/WebGLTexture.cpp
--- a/dom/canvas/WebGLTexture.cpp
+++ b/dom/canvas/WebGLTexture.cpp
@@ -557,23 +557,26 @@ ClearWithTempFB(WebGLContext* webgl, GLu
     case LOCAL_GL_RGB:
     case LOCAL_GL_RGBA:
     case LOCAL_GL_BGR:
     case LOCAL_GL_BGRA:
         mask = LOCAL_GL_COLOR_BUFFER_BIT;
         gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0,
                                   texImageTarget.get(), tex, level);
         break;
-
+    case LOCAL_GL_DEPTH_COMPONENT32_OES:
+    case LOCAL_GL_DEPTH_COMPONENT24_OES:
+    case LOCAL_GL_DEPTH_COMPONENT16:
     case LOCAL_GL_DEPTH_COMPONENT:
         mask = LOCAL_GL_DEPTH_BUFFER_BIT;
         gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_DEPTH_ATTACHMENT,
                                   texImageTarget.get(), tex, level);
         break;
 
+    case LOCAL_GL_DEPTH24_STENCIL8:
     case LOCAL_GL_DEPTH_STENCIL:
         mask = LOCAL_GL_DEPTH_BUFFER_BIT |
                LOCAL_GL_STENCIL_BUFFER_BIT;
         gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_DEPTH_ATTACHMENT,
                                   texImageTarget.get(), tex, level);
         gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_STENCIL_ATTACHMENT,
                                   texImageTarget.get(), tex, level);
         break;