summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-06-10 21:29:25 +0100
committerJosé Fonseca <[email protected]>2009-06-10 21:29:25 +0100
commit337f559cd2d98a858719cb963450fef2256e83f7 (patch)
treeb5c63ac8681ca9ceff6e70306513874b6779778a /src
parent8fa8669aeba45d1b57f3cc41429578d55cad378a (diff)
mesa: Reverse s8z24 into z24s8 as required by EXT_packed_depth_stencil.
Actually, after spotting this problem, I realized this is unreachable code. However don't bother to enable this fast path now, given the normal path is working just fine.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 86baf3ddefd..ccf1a0b5634 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -445,11 +445,16 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
}
else {
- /* untested, but simple: */
+ /* XXX: unreachable code -- should be before st_read_stencil_pixels */
assert(format == GL_DEPTH_STENCIL_EXT);
for (i = 0; i < height; i++) {
+ GLuint *zshort = (GLuint *)dst;
pipe_get_tile_raw(trans, 0, y, width, 1, dst, 0);
y += yStep;
+ /* Reverse into 24/8 */
+ for (j = 0; j < width; j++) {
+ zshort[j] = (zshort[j] << 8) | (zshort[j] >> 24);
+ }
dst += dstStride;
}
}
@@ -472,7 +477,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
}
else {
- /* untested, but simple: */
+ /* XXX: unreachable code -- should be before st_read_stencil_pixels */
assert(format == GL_DEPTH_STENCIL_EXT);
for (i = 0; i < height; i++) {
pipe_get_tile_raw(trans, 0, y, width, 1, dst, 0);