From ac822ee2fc4dbb4e67ec0587aba0ff32c7346c66 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 13 Sep 2018 15:16:29 +0200 Subject: [PATCH] Remove erroneous check from CopyTexImage2D The internal format of the bound texture doesn't matter, what matters is which components can be found in the framebuffer. --- components/script/dom/webglrenderingcontext.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 94ec89b2b1c..eb7be0019e9 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -1752,22 +1752,6 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { Err(_) => return, }; - let image_info = texture.image_info_for_target(&target, level); - - // The color buffer components can be dropped during the conversion to - // the internal_format, but new components cannot be added. - // - // Note that this only applies if we're copying to an already - // initialized texture. - // - // GL_INVALID_OPERATION is generated if the color buffer cannot be - // converted to the internal_format. - if let Some(old_internal_format) = image_info.internal_format() { - if old_internal_format.components() > internal_format.components() { - return self.webgl_error(InvalidOperation); - } - } - // NB: TexImage2D depth is always equal to 1 handle_potential_webgl_error!(self, texture.initialize(target, width as u32,