swrast: Fix fastpaths in glRead/WritePixels(GL_DEPTH_STENCIL)
authorChad Versace <chad@chad-versace.us>
Mon, 10 Oct 2011 22:07:14 +0000 (15:07 -0700)
committerChad Versace <chad@chad-versace.us>
Sat, 15 Oct 2011 22:45:07 +0000 (15:45 -0700)
commit244a02c47d0de860db4183212f8a33c2c02d95db
tree182584f799aac6b55138ac9cfcfd97d005289d2b
parent9934bfe28d3c0f6551ba2cc806a7fe8e0a16ed7c
swrast: Fix fastpaths in glRead/WritePixels(GL_DEPTH_STENCIL)

For glReadPixels, the user supplied pixels have format
GL_UNSIGNED_INT_24_8.  But, when the depthstencil buffer's format was
MESA_FORMAT_S8_Z24, the fastpath read from the buffer without reordering
the depth and stencil bits. To fix this, this patch just skips the
fastpath when the format is not MESA_FORMAT_Z24_S8.

The problem and fix for glWritePixels is analagous.

Fixes the Piglit tests below on i965/gen6 and causes no regressions.
   general/depthstencil-default_fb-drawpixels-24_8
   general/depthstencil-default_fb-readpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-drawpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
src/mesa/swrast/s_drawpix.c
src/mesa/swrast/s_readpix.c