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 <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
macos/master
Gert Wollny 6 years ago
parent 8830112be7
commit 18f9778c16
  1. 9
      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) {

Loading…
Cancel
Save