panfrost: Align NPOT divisor records
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 3 Jun 2021 19:06:05 +0000 (15:06 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 10 Jun 2021 18:06:10 +0000 (18:06 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>

src/gallium/drivers/panfrost/pan_cmdstream.c

index abf6bd3..dac6e3f 100644 (file)
@@ -1756,6 +1756,10 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
                         unsigned magic_divisor =
                                 panfrost_compute_magic_divisor(hw_divisor, &shift, &extra_flags);
 
+                        /* Records with continuations must be aligned */
+                        k = ALIGN_POT(k, 2);
+                        attrib_to_buffer[i] = k;
+
                         pan_pack(bufs + k, ATTRIBUTE_BUFFER, cfg) {
                                 cfg.type = MALI_ATTRIBUTE_TYPE_1D_NPOT_DIVISOR;
                                 cfg.pointer = addr;