vrend: Check the texture is attached as color

GL_IMPLEMENTATION_COLOR_READ_TYPE and
GL_IMPLEMENTATION_COLOR_READ_FORMAT works only if a texture is
attached as a color buffer.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/715>
macos/master
Akihiko Odaki 3 years ago committed by Marge Bot
parent 75207aaac9
commit c5a07789c0
  1. 2
      src/vrend_renderer.c

@ -8191,7 +8191,7 @@ static void do_readpixels(struct vrend_resource *res,
But we have found that at least Mesa returned the wrong formats, again But we have found that at least Mesa returned the wrong formats, again
luckily we are able to change Mesa. But just in case there are more bad luckily we are able to change Mesa. But just in case there are more bad
drivers out there, or we mess up the format somewhere, we warn here. */ drivers out there, or we mess up the format somewhere, we warn here. */
if (vrend_state.use_gles) { if (vrend_state.use_gles && !vrend_format_is_ds(res->base.format)) {
GLint imp; GLint imp;
if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_INT && if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_INT &&
type != GL_INT && type != GL_FLOAT) { type != GL_INT && type != GL_FLOAT) {

Loading…
Cancel
Save