[WebGL] Fix framebufferTexture2D with DEPTH_STENCIL_ATTACHMENT on ANGLE
authorjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Nov 2019 21:47:59 +0000 (21:47 +0000)
committerjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Nov 2019 21:47:59 +0000 (21:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=204433

Reviewed by Dean Jackson.

ANGLE expects requests for DEPTH_STENCIL_ATTACHMENT to not be split into two calls, as previous WebGL 1 backend required.

No new tests. Prevents conformance/extensions/webgl-depth-texture.html regression when run with the ANGLE backend.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::framebufferTexture2D):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252751 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

index 4e01db7..e4be6f0 100644 (file)
@@ -1,3 +1,17 @@
+2019-11-21  Justin Fan  <justin_fan@apple.com>
+
+        [WebGL] Fix framebufferTexture2D with DEPTH_STENCIL_ATTACHMENT on ANGLE
+        https://bugs.webkit.org/show_bug.cgi?id=204433
+
+        Reviewed by Dean Jackson.
+
+        ANGLE expects requests for DEPTH_STENCIL_ATTACHMENT to not be split into two calls, as previous WebGL 1 backend required.
+
+        No new tests. Prevents conformance/extensions/webgl-depth-texture.html regression when run with the ANGLE backend.
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
+
 2019-11-21  Zalan Bujtas  <zalan@apple.com>
 
         [LFC][IFC] Cache trailing trimmable width.
index 2191b89..53a1f20 100644 (file)
@@ -2472,20 +2472,15 @@ void WebGLRenderingContextBase::framebufferTexture2D(GC3Denum target, GC3Denum a
         return;
     }
     Platform3DObject textureObject = objectOrZero(texture);
-    switch (attachment) {
-    case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+
+#if !USE_ANGLE
+    if (attachment == GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT) {
         m_context->framebufferTexture2D(target, GraphicsContext3D::DEPTH_ATTACHMENT, textarget, textureObject, level);
         m_context->framebufferTexture2D(target, GraphicsContext3D::STENCIL_ATTACHMENT, textarget, textureObject, level);
-        break;
-    case GraphicsContext3D::DEPTH_ATTACHMENT:
-        m_context->framebufferTexture2D(target, attachment, textarget, textureObject, level);
-        break;
-    case GraphicsContext3D::STENCIL_ATTACHMENT:
-        m_context->framebufferTexture2D(target, attachment, textarget, textureObject, level);
-        break;
-    default:
+    } else
+#endif
         m_context->framebufferTexture2D(target, attachment, textarget, textureObject, level);
-    }
+
     targetFramebuffer->setAttachmentForBoundFramebuffer(attachment, textarget, texture, level);
     applyStencilTest();
 }