summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-07-08 08:53:09 -0600
committerBrian <[email protected]>2007-07-08 08:53:09 -0600
commit9fa3bbcb5ab590dc4cb3ca55768e8f21e7a083e9 (patch)
treeb0e7af8a00b5d2456cd8dc86ec26ee2839e3282b /src/mesa
parent99d62f2922686ba73e858b612fec770724f0649d (diff)
check depthScale value for optimized ushort->uint case (fixes bug 11474)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/image.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index e874719e645..e5b9ce82800 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;