softpipe: fix clears to only clear specified color buffers.
authorDave Airlie <airlied@redhat.com>
Tue, 26 Mar 2019 05:25:18 +0000 (15:25 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 26 Mar 2019 21:53:32 +0000 (07:53 +1000)
This fixes piglit clearbuffer-mixed-format

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/softpipe/sp_clear.c

index ba04fd0aa873a0b32e1812dc96526bf23dad21ae..d2626a24333ea6f8576432ca5a7b1333098afef0 100644 (file)
@@ -68,7 +68,8 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers,
 
    if (buffers & PIPE_CLEAR_COLOR) {
       for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) {
-         sp_tile_cache_clear(softpipe->cbuf_cache[i], color, 0);
+         if (buffers & (PIPE_CLEAR_COLOR0 << i))
+            sp_tile_cache_clear(softpipe->cbuf_cache[i], color, 0);
       }
    }