From bb577051dd5dbb5519f770eabf149de8675770ba Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 3 Jul 2020 12:04:53 -0400 Subject: [PATCH] panfrost: Enable MSAA if we render to such a surface We hit this case for clears of MSAA surfaces without draws. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_mfbd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index 880a1aaf19c..558ba866c56 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -224,6 +224,9 @@ panfrost_mfbd_set_cbuf( rt->format = panfrost_mfbd_format(surf); + if (layer_stride) + rt->format.flags |= MALI_MFBD_FORMAT_MSAA | MALI_MFBD_FORMAT_LAYERED; + /* Now, we set the layout specific pieces */ if (rsrc->layout == MALI_TEXTURE_LINEAR) { @@ -521,6 +524,14 @@ panfrost_mfbd_fragment(struct panfrost_batch *batch, bool has_draws) struct pipe_surface *surf = batch->key.cbufs[cb]; if (surf) { + unsigned nr_samples = surf->nr_samples; + + if (!nr_samples) + nr_samples = surf->texture->nr_samples; + + if (nr_samples > 1) + batch->requirements |= PAN_REQ_MSAA; + panfrost_mfbd_set_cbuf(&rts[cb], surf); /* What is this? Looks like some extension of the bpp -- 2.30.2