From 64359af07188c06dcc6a9a95ba05f7e8209a7379 Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 8 Jul 2007 08:53:19 -0600 Subject: check depthScale value for optimized ushort->uint case (fixes bug 11474) --- src/mesa/main/image.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index e874719e64..e5b9ce8280 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -3882,6 +3882,16 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, } \ } while (0) + +/** + * Unpack a row of depth/z values from memory, returning GLushort, GLuint + * or GLfloat values. + * The glPixelTransfer (scale/bias) params will be applied. + * + * \param dstType one of GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, GL_FLOAT + * \param depthScale scale factor (max value) for returned GLushort or + * GLuint values (ignored for GLfloat). + */ void _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLfloat depthScale, @@ -3907,7 +3917,9 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, } return; } - if (srcType == GL_UNSIGNED_SHORT && dstType == GL_UNSIGNED_INT) { + if (srcType == GL_UNSIGNED_SHORT + && dstType == GL_UNSIGNED_INT + && depthScale == (GLfloat) 0xffffffff) { const GLushort *src = (const GLushort *) source; GLuint *dst = (GLuint *) dest; GLuint i; -- cgit v1.2.3