From 69bfa25ac0bf7de0b589dc0fba3707badc0b52e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Tue, 15 Sep 2015 09:17:20 +0300 Subject: [PATCH] mesa: allow GL_DEPTH_COMPONENT in glReadPixels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix regression caused by 81d2fd9 in following CTS test: ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels Signed-off-by: Tapani Pälli Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92009 --- src/mesa/main/glformats.c | 6 ++++-- src/mesa/main/readpix.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index c1d3c7d..d1f9f67 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -494,7 +494,8 @@ _mesa_bytes_per_pixel(GLenum format, GLenum type) else return -1; case GL_UNSIGNED_INT_24_8_EXT: - if (format == GL_DEPTH_STENCIL_EXT) + if (format == GL_DEPTH_COMPONENT || + format == GL_DEPTH_STENCIL_EXT) return sizeof(GLuint); else return -1; @@ -1789,7 +1790,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return GL_INVALID_OPERATION; case GL_UNSIGNED_INT_24_8: - if (format != GL_DEPTH_STENCIL) { + if (format != GL_DEPTH_COMPONENT && + format != GL_DEPTH_STENCIL) { return GL_INVALID_OPERATION; } return GL_NO_ERROR; diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 76ef8ee..81bb912 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -963,6 +963,7 @@ read_pixels_es3_error_check(GLenum format, GLenum type, return GL_NO_ERROR; break; case GL_UNSIGNED_SHORT: + case GL_UNSIGNED_INT: case GL_UNSIGNED_INT_24_8: if (!is_float_depth) return GL_NO_ERROR; -- 2.4.3