summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-07-03 12:04:53 -0400
committerMarge Bot <eric+marge@anholt.net>2020-07-07 01:13:39 +0000
commitbb577051dd5dbb5519f770eabf149de8675770ba (patch)
tree58d4331e7eee81a025f04933bed737f170f3fecd
parent3b7aeb2448a1c3cfad43db5ae3eff897dffed627 (diff)
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 <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
-rw-r--r--src/gallium/drivers/panfrost/pan_mfbd.c11
1 files changed, 11 insertions, 0 deletions
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