From d0cc0e74dd9b2aa116f7672388257a0facf6f4bd Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 9 Feb 2024 10:22:15 +0100 Subject: [PATCH] mesa/main: mark GL_BGRA8_EXT as color-renderable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While this is not quite as clear as in the previous commit, I still believe this is the case, but in a bit of an indirect way: 1. EXT_texture_storage defines that GL_BGRA8_EXT is allowed to be used in certain sitations if *either* EXT_texture_format_BGRA8888 *or* APPLE_texture_format_BGRA8888 is supported. 2. Surprisingly, EXT_texture_format_BGRA8888 (which we do support) does not even mention GL_BGRA8_EXT, only GL_BGRA_EXT. 3. APPLE_texture_format_BGRA8888 on the other hand (which we *don't* support) *does* introduce GL_BGRA8_EXT, and is pretty clear about it being intended for rendering-purposes. But it's written against GLES 1.1 instead of GLES 2 or later, so it doesn't explicitly add it to the required tables. I think the above tells us that GL_BGRA8_EXT is *supposed* to be a color-renderable format, even if the way we currently support it is rather underspecified. It should also be texture-filterable, for the same reason as in the previous commit. In the longer run, we should probably add support for APPLE_texture_format_BGRA8888, which would make things a bit clearer. Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/glformats.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 5fbcb0f3afd..15f089cc9fc 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -4030,6 +4030,10 @@ _mesa_is_es3_color_renderable(const struct gl_context *ctx, case GL_BGRA: assert(_mesa_has_EXT_texture_format_BGRA8888(ctx)); return true; + case GL_BGRA8_EXT: + assert(_mesa_has_EXT_texture_format_BGRA8888(ctx) && + _mesa_has_EXT_texture_storage(ctx)); + return true; default: return false; } @@ -4091,6 +4095,10 @@ _mesa_is_es3_texture_filterable(const struct gl_context *ctx, case GL_BGRA: assert(_mesa_has_EXT_texture_format_BGRA8888(ctx)); return true; + case GL_BGRA8_EXT: + assert(_mesa_has_EXT_texture_format_BGRA8888(ctx) && + _mesa_has_EXT_texture_storage(ctx)); + return true; default: return false; }