From: Luca Barbieri Date: Sun, 19 Sep 2010 19:48:28 +0000 (+0200) Subject: auxiliary: fix depth-only and stencil-only clears X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a01578c84ffcc03a98b3c3f20d05cdb0e0e4ada7;p=mesa.git auxiliary: fix depth-only and stencil-only clears Depth-only and stencil-only clears should mask out depth/stencil from the output, mask out stencil/input from input, and OR or ADD them together. However, due to a typo they were being ANDed, resulting in zeroing the buffer. --- diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index af99163b2ed..f78b6838a72 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -332,7 +332,7 @@ util_clear_depth_stencil(struct pipe_context *pipe, uint32_t *row = (uint32_t *)dst_map; for (j = 0; j < width; j++) { uint32_t tmp = *row & dst_mask; - *row++ = tmp & (zstencil & ~dst_mask); + *row++ = tmp | (zstencil & ~dst_mask); } dst_map += dst_stride; }