mesa/main: validate bgr formats

BGR and BGRA formats are either supported by desktop GL or by the
EXT_texture_format_BGRA8888 extension. Either of these should always be
supported, so let's just assert it and return true.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
This commit is contained in:
Erik Faye-Lund 2024-06-18 16:16:32 +02:00 committed by Marge Bot
parent e8226bda60
commit 87edfee086

View file

@ -1748,6 +1748,12 @@ valid_texture_format_enum(const struct gl_context *ctx, GLenum format)
case GL_BLUE:
return _mesa_is_desktop_gl(ctx);
case GL_BGR:
case GL_BGRA:
assert(_mesa_is_desktop_gl(ctx) ||
_mesa_has_EXT_texture_format_BGRA8888(ctx));
return true;
case GL_DEPTH_COMPONENT:
return _mesa_is_desktop_gl(ctx) ||
_mesa_has_OES_depth_texture(ctx);