From cf8f89492153cf0fa2ca5364cdbcf1b74925b3eb Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 21 Mar 2024 17:53:49 +1100 Subject: [PATCH] teximage: allow glCopyTex{Sub}Image[123]D into R/RG textures with OpenGL ES 2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is explicitly allowed in the GL_EXT_texture_rg extension. Cc: mesa-stable Reviewed-by: Tapani Pälli Part-of: --- src/mesa/main/teximage.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index da85d900157..24464f6d0ef 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2476,6 +2476,15 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, case GL_RGB10_A2: break; + case GL_RED: + case GL_RG: + /* GL_EXT_texture_rg adds support for GL_RED and GL_RG as an internal + * format + */ + if (_mesa_has_EXT_texture_rg(ctx)) + break; + + FALLTHROUGH; default: _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%dD(internalFormat=%s)", dimensions,