From: Alyssa Rosenzweig Date: Fri, 3 Jul 2020 16:04:53 +0000 (-0400) Subject: panfrost: Enable MSAA if we render to such a surface X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb577051dd5dbb5519f770eabf149de8675770ba;p=mesa.git 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: --- 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