cogl/gles: Require OES_rgb8_rgba8 to have color-renderable 8bpc formats

In GLES 2.0 the required color-renderable formats to support to not
include 8bpc RGB/RGBA formats. The extension adds this requirement and
makes GLES 2.0 actually useable. Not specifying a gl internal format in
Cogl so far has hidden the problem and let the implementation fall back
to RGB585 for example.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3429>
This commit is contained in:
Sebastian Wick 2023-12-04 19:44:49 +01:00 committed by Marge Bot
parent f77d95c9ae
commit bbf2d83e94

View File

@ -374,6 +374,17 @@ _cogl_driver_update_features (CoglContext *context,
gl_minor, gl_minor,
gl_extensions); gl_extensions);
if (!_cogl_check_extension ("OES_rgb8_rgba8", gl_extensions) &&
!COGL_CHECK_GL_VERSION (gl_major, gl_minor, 3, 0))
{
g_set_error (error,
COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_INVALID_VERSION,
"OES_rgb8_rgba8 is required for GLES 2");
g_strfreev (gl_extensions);
return FALSE;
}
if (_cogl_check_extension ("GL_ANGLE_pack_reverse_row_order", gl_extensions)) if (_cogl_check_extension ("GL_ANGLE_pack_reverse_row_order", gl_extensions))
COGL_FLAGS_SET (private_features, COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_MESA_PACK_INVERT, TRUE); COGL_PRIVATE_FEATURE_MESA_PACK_INVERT, TRUE);