From c5a07789c09dba4dce58b2b0d74cb7cff8e027de Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Fri, 18 Feb 2022 13:37:58 +0900 Subject: [PATCH] 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 Part-of: --- src/vrend_renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index cd1fea0..aca3826 100644 --- a/src/vrend_renderer.c +++ b/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 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. */ - if (vrend_state.use_gles) { + if (vrend_state.use_gles && !vrend_format_is_ds(res->base.format)) { GLint imp; if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_INT && type != GL_INT && type != GL_FLOAT) {