From 18f9778c16ed398038a45c51cb7957b020f34d7e Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 14 May 2019 19:19:55 +0200 Subject: [PATCH] formats: readback hotfix for BGR10A2 formats On GLES the formats B10G10R10A2_UNORM and B10G10R10X2_UNORM are defined like R10G10B10.2_UNORM on desktop GL, which is likely incorrect and interferes with the readback. Using the blit workaround seems to work in these cases, so disable diect readback in these cases. Signed-off-by: Gert Wollny Reviewed-by: Erik Faye-Lund --- src/vrend_formats.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vrend_formats.c b/src/vrend_formats.c index 32a7504..e03b9b6 100644 --- a/src/vrend_formats.c +++ b/src/vrend_formats.c @@ -310,6 +310,15 @@ static bool color_format_can_readback(struct vrend_format_table *virgl_format, i (gles_ver >= 32 || epoxy_has_gl_extension("GL_EXT_color_buffer_float"))) return true; + /* Hotfix for the CI, on GLES these formats are defined like + * VIRGL_FORMAT_R10G10B10.2_UNORM, and seems to be incorrect for direct + * readback but the blit workaround seems to work, so disable the + * direct readback for these two formats. */ + if (virgl_format->format == VIRGL_FORMAT_B10G10R10A2_UNORM || + virgl_format->format == VIRGL_FORMAT_B10G10R10X2_UNORM) + return false; + + /* Check implementation specific readback formats */ glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &imp); if (imp == (GLint)virgl_format->gltype) {