summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_surface.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-02-11 16:39:42 -0700
committerBrian Paul <[email protected]>2013-02-12 08:11:05 -0700
commit4bfdef87e66bfb2459af570351798d7754ddfb9f (patch)
treebf2ed302a1cf52ad0f46ba856bde7d7f77a3aa44 /src/gallium/auxiliary/util/u_surface.c
parenta79ce0c925809f0aeaa51b9c3122912c36c646d2 (diff)
util: fix incorrect Z bit masking in util_clear_depth_stencil()
For PIPE_FORMAT_Z24_UNORM_S8_UINT, the Z bits are in the 24 least significant bits. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60527 and http://bugs.freedesktop.org/show_bug.cgi?id=60524 and http://bugs.freedesktop.org/show_bug.cgi?id=60047 Note: This is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_surface.c')
-rw-r--r--src/gallium/auxiliary/util/u_surface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 37f48154f18..b948b46d25f 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -421,10 +421,10 @@ util_clear_depth_stencil(struct pipe_context *pipe,
else {
uint32_t dst_mask;
if (format == PIPE_FORMAT_Z24_UNORM_S8_UINT)
- dst_mask = 0xffffff00;
+ dst_mask = 0x00ffffff;
else {
assert(format == PIPE_FORMAT_S8_UINT_Z24_UNORM);
- dst_mask = 0xffffff;
+ dst_mask = 0xffffff00;
}
if (clear_flags & PIPE_CLEAR_DEPTH)
dst_mask = ~dst_mask;