get_tile() of Z surfaces returns floats now
This commit is contained in:
@@ -136,20 +136,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
|
|||||||
GLvoid *dst = _mesa_image_address2d(&clippedPacking, dest, width,
|
GLvoid *dst = _mesa_image_address2d(&clippedPacking, dest, width,
|
||||||
height, format, type, i, 0);
|
height, format, type, i, 0);
|
||||||
if (format == GL_DEPTH_COMPONENT) {
|
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,
|
_mesa_pack_depth_span(ctx, width, dst, type,
|
||||||
z, &clippedPacking);
|
(GLfloat *) temp, &clippedPacking);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_mesa_pack_rgba_span_float(ctx, width, temp, format, type, dst,
|
_mesa_pack_rgba_span_float(ctx, width, temp, format, type, dst,
|
||||||
|
Reference in New Issue
Block a user