From d8612720f6b14e971fddd244f68c6174b52222c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 10 Oct 2022 22:15:34 +0200 Subject: cogl/driver/gles: Handle reading RGBA1010102 too This means can read without loosing precision, compared to if we read a texture as rgb8. Part-of: --- cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 41387a3eb..7e3a29b82 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -280,6 +280,13 @@ _cogl_driver_read_pixels_format_supported (CoglContext *context, if (glformat == GL_RGBA && gltype == GL_UNSIGNED_BYTE) return TRUE; + if (glintformat == GL_RGB10_A2_EXT && + glformat == GL_RGBA && + gltype == GL_UNSIGNED_INT_2_10_10_10_REV_EXT && + _cogl_has_private_feature (context, + COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102)) + return TRUE; + return FALSE; } -- cgit v1.2.1