mesa/main: mark GL_BGRA8_EXT as color-renderable

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 <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27521>
This commit is contained in:
Erik Faye-Lund 2024-02-09 10:22:15 +01:00 committed by Marge Bot
parent 2b2a6a238e
commit d0cc0e74dd

View file

@ -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;
}