panfrost: Include pointer for each sample
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 30 Jun 2020 20:43:47 +0000 (16:43 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Jul 2020 01:13:39 +0000 (01:13 +0000)
Treating it like an array/3D texture.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>

src/panfrost/encoder/pan_texture.c

index 54a5398e299482e02e5de26c217caab42f5cbe09..a333dadc0797af75471ebed566895b57fbaaeea4 100644 (file)
@@ -215,22 +215,26 @@ panfrost_emit_texture_payload(
                 panfrost_adjust_cube_dimensions(&first_face, &last_face, &first_layer, &last_layer);
         }
 
+        nr_samples = MAX2(nr_samples, 1);
+
         unsigned idx = 0;
 
         for (unsigned w = first_layer; w <= last_layer; ++w) {
                 for (unsigned l = first_level; l <= last_level; ++l) {
                         for (unsigned f = first_face; f <= last_face; ++f) {
-                                payload[idx++] = base + panfrost_texture_offset(
-                                                slices, type == MALI_TEX_3D,
-                                                cube_stride, l, w * face_mult + f);
-
-                                if (manual_stride) {
-                                        payload[idx++] = (layout == MALI_TEXTURE_LINEAR) ?
-                                                slices[l].stride :
-                                                panfrost_nonlinear_stride(layout,
-                                                                MAX2(desc->block.bits / 8, 1),
-                                                                u_minify(width, l),
-                                                                u_minify(height, l));
+                                for (unsigned s = 0; s < nr_samples; ++s) {
+                                        payload[idx++] = base + panfrost_texture_offset(
+                                                        slices, type == MALI_TEX_3D,
+                                                        cube_stride, l, w * face_mult + f, s);
+
+                                        if (manual_stride) {
+                                                payload[idx++] = (layout == MALI_TEXTURE_LINEAR) ?
+                                                        slices[l].stride :
+                                                        panfrost_nonlinear_stride(layout,
+                                                                        MAX2(desc->block.bits / 8, 1),
+                                                                        u_minify(width, l),
+                                                                        u_minify(height, l));
+                                        }
                                 }
                         }
                 }