aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-07-15 12:02:32 -0400
committerMarge Bot <[email protected]>2020-07-15 22:19:37 +0000
commit64734c0947ecfb8908e6bdfd4e73a4c724019476 (patch)
tree47218e4390df5a8d1a6930791cabfcd75c2ff54a /src/gallium/drivers
parent8225604fd520de6cfbfcfbafccfa7f049a1c4355 (diff)
panfrost: Set zs_samples as necessary
Fixes MSAA Z/S. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/panfrost/pan_mfbd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c
index e1c389c3904..247dfd1ae18 100644
--- a/src/gallium/drivers/panfrost/pan_mfbd.c
+++ b/src/gallium/drivers/panfrost/pan_mfbd.c
@@ -285,6 +285,15 @@ panfrost_mfbd_set_zsbuf(
bool is_bifrost = dev->quirks & IS_BIFROST;
struct panfrost_resource *rsrc = pan_resource(surf->texture);
+ unsigned nr_samples = surf->nr_samples;
+
+ if (!nr_samples)
+ nr_samples = surf->texture->nr_samples;
+
+ nr_samples = MAX2(nr_samples, 1);
+
+ fbx->zs_samples = MALI_POSITIVE(nr_samples);
+
unsigned level = surf->u.tex.level;
unsigned first_layer = surf->u.tex.first_layer;
assert(surf->u.tex.last_layer == first_layer);
@@ -315,11 +324,6 @@ panfrost_mfbd_set_zsbuf(
int stride = rsrc->slices[level].stride;
- unsigned nr_samples = surf->nr_samples;
-
- if (!nr_samples)
- nr_samples = surf->texture->nr_samples;
-
unsigned layer_stride = (nr_samples > 1) ? rsrc->slices[level].size0 : 0;
fb->mfbd_flags |= MALI_MFBD_EXTRA | MALI_MFBD_DEPTH_WRITE;