get_tile() of Z surfaces returns floats now
authorBrian <brian.paul@tungstengraphics.com>
Sat, 13 Oct 2007 15:05:20 +0000 (09:05 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Sat, 13 Oct 2007 15:05:20 +0000 (09:05 -0600)
src/mesa/state_tracker/st_cb_readpixels.c

index a82c4e526aaca2577d153f042eb80b4d9d1b586a..35cf64bae2952d1f81ec64b5d001d94545abffcf 100644 (file)
@@ -136,20 +136,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
          GLvoid *dst = _mesa_image_address2d(&clippedPacking, dest, width,
                                              height, format, type, i, 0);
          if (format == GL_DEPTH_COMPONENT) {
-            float z[MAX_WIDTH];
-            if (strb->surface->format == PIPE_FORMAT_S8_Z24) {
-               const double scale = 1.0 / ((1 << 24) - 1);
-               const uint *zs = (const uint *) temp;
-               uint k;
-               for (k = 0; k < width; k++) {
-                  z[k] = (zs[k] & 0xffffff) * scale;
-               }
-            }
-            else {
-               assert(0);
-            }
             _mesa_pack_depth_span(ctx, width, dst, type,
-                                  z, &clippedPacking);
+                                  (GLfloat *) temp, &clippedPacking);
          }
          else {
             _mesa_pack_rgba_span_float(ctx, width, temp, format, type, dst,