summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2015-09-15 09:17:20 +0300
committerTapani Pälli <tapani.palli@intel.com>2015-09-18 07:41:47 +0300
commitafa1efdc8522d987e3af7c7a6272021caa33eb82 (patch)
tree3de6372f32614525c324b24bc4bcd85c515c4d76 /src/mesa/main/readpix.c
parent2e4ab489b5963e57df01fa20bb95d67139de8b75 (diff)
downloadexternal_mesa3d-afa1efdc8522d987e3af7c7a6272021caa33eb82.zip
external_mesa3d-afa1efdc8522d987e3af7c7a6272021caa33eb82.tar.gz
external_mesa3d-afa1efdc8522d987e3af7c7a6272021caa33eb82.tar.bz2
mesa: fix errors when reading depth with glReadPixels
OpenGL ES 3.0 spec 3.7.2 "Transfer of Pixel Rectangles" specifies DEPTH_COMPONENT, UNSIGNED_INT as a valid couple, validation for internal format is checked by is_float_depth(). Fix regression caused by 81d2fd91a90e5b2fd9fd74792a7a7c329f0e4d29 in: ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels Test uses GL_DEPTH_COMPONENT, UNSIGNED_INT only when GL_NV_read_depth extension is present. v2: change check in _mesa_error_check_format_and_type to be explicit for ES 2.0+, desktop OpenGL does not allow this behaviour + uses this function for both glReadPixels and glDrawPixels validation. (No Piglit regressions seen with v2.) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [v1] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92009 Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c1
1 files changed, 1 insertions, 0 deletions
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;