auxiliary: fix depth-only and stencil-only clears
authorLuca Barbieri <luca@luca-barbieri.com>
Sun, 19 Sep 2010 19:48:28 +0000 (21:48 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Sun, 19 Sep 2010 19:52:02 +0000 (21:52 +0200)
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.

src/gallium/auxiliary/util/u_surface.c

index af99163b2ed2b780cddb0d698a1ab60e21545eb4..f78b6838a72e53ca5907c13d4e0f5c279565fc33 100644 (file)
@@ -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;
             }