From 13ff5756ae6a265772b61ecc3757a91d3826cecf Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 30 Mar 2021 09:34:58 +0200 Subject: [PATCH] panfrost: Don't reserve space in the color buffer for disabled RTs Render targets that have no clear or draws are disabled and thus don't use the color buffer. Don't reserve space for those. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_mfbd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index 214931f55a7..8658b826685 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -424,6 +424,9 @@ pan_internal_cbuf_size(struct panfrost_batch *batch, unsigned *tile_size) for (int cb = 0; cb < batch->key.nr_cbufs; ++cb) { struct pipe_surface *surf = batch->key.cbufs[cb]; + if (!((batch->clear | batch->draws) & (PIPE_CLEAR_COLOR0 << cb))) + surf = NULL; + if (!surf) continue;