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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2461>
This commit is contained in:
Jonas Ådahl 2022-10-10 22:15:34 +02:00 committed by Marge Bot
parent 8e65e510d4
commit d8612720f6

View File

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