From e77013fb7fd469bf39d54fd82f0f1e60b1b436a0 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 26 Mar 2019 15:25:18 +1000 Subject: [PATCH] softpipe: fix clears to only clear specified color buffers. This fixes piglit clearbuffer-mixed-format Reviewed-by: Brian Paul --- src/gallium/drivers/softpipe/sp_clear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/softpipe/sp_clear.c b/src/gallium/drivers/softpipe/sp_clear.c index ba04fd0aa87..d2626a24333 100644 --- a/src/gallium/drivers/softpipe/sp_clear.c +++ b/src/gallium/drivers/softpipe/sp_clear.c @@ -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); } } -- 2.30.2