From 9bcdb9481cfaf4e469edb8d0d92f35863b434fda 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 --- 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 9f37471..51e46d9 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) {