mesa: fix inconsistent use of GL_UNSIGNED_INT vs. GL_UNSIGNED_INT_24_8_EXT for Z...
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 17 Jun 2008 22:43:48 +0000 (16:43 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 17 Jun 2008 22:44:55 +0000 (16:44 -0600)
src/mesa/main/image.c
src/mesa/main/texstore.c

index a6ac821251a74080b2c53e921ac226c641377784..52c4999e16e90723bc691ffb1cbb8be75ef9fa65 100644 (file)
@@ -4447,7 +4447,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
          DEPTH_VALUES(GLuint, UINT_TO_FLOAT);
          break;
       case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */
-         if (dstType == GL_UNSIGNED_INT &&
+         if (dstType == GL_UNSIGNED_INT_24_8_EXT &&
              depthMax == 0xffffff &&
              ctx->Pixel.DepthScale == 1.0 &&
              ctx->Pixel.DepthBias == 0.0) {
index 5ac61169503047f4ba6a290e61d093b5bb13c935..562e07a0f5887c9500360ce8c17d4343b025560e 100644 (file)
@@ -2336,7 +2336,7 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS)
 GLboolean
 _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
 {
-   const GLuint depthScale = 0xffffff;
+   const GLfloat depthScale = (GLfloat) 0xffffff;
 
    ASSERT(dstFormat == &_mesa_texformat_z24_s8);
    ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT);
@@ -2374,7 +2374,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
             GLint i;
             /* the 24 depth bits will be in the high position: */
             _mesa_unpack_depth_span(ctx, srcWidth,
-                                    GL_UNSIGNED_INT, /* dst type */
+                                    GL_UNSIGNED_INT_24_8_EXT, /* dst type */
                                     dstRow, /* dst addr */
                                     depthScale,
                                     srcType, src, srcPacking);