From bbf2d83e94a35416fd553418388af8cb6cf1e8dc Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 4 Dec 2023 19:44:49 +0100 Subject: [PATCH] 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: --- cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 111adb60e..82b762c8f 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -374,6 +374,17 @@ _cogl_driver_update_features (CoglContext *context, gl_minor, 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)) COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_MESA_PACK_INVERT, TRUE);