From aa48742190854571ee8b24c1df943318fd16b1ae Mon Sep 17 00:00:00 2001 From: Jeff Gilbert Date: Wed, 27 May 2020 22:51:40 +0000 Subject: [PATCH] Bug 1636517 - When detaching a webgl fb attachment, reset params to defaults. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D77177 --- dom/canvas/WebGLContextGL.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp index 1ba61c129630..4f8406752b65 100644 --- a/dom/canvas/WebGLContextGL.cpp +++ b/dom/canvas/WebGLContextGL.cpp @@ -340,6 +340,9 @@ void WebGLContext::FramebufferAttach(const GLenum target, } auto safeToAttach = toAttach; + if (!toAttach.rb && !toAttach.tex) { + safeToAttach = {}; + } if (!IsWebGL2() && !IsExtensionEnabled(WebGLExtensionID::OES_fbo_render_mipmap)) { safeToAttach.mipLevel = 0;