pan/bi: Align spilled registers on Valhall
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 3 May 2022 21:01:24 +0000 (17:01 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 4 May 2022 12:48:27 +0000 (12:48 +0000)
Required to support packed addressing correctly. Fixes (with spilling forced):

dEQP-GLES2.functional.shaders.random.trigonometric.vertex.20

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

src/panfrost/bifrost/bi_ra.c

index 8b14c0e..8a7fa63 100644 (file)
@@ -591,6 +591,14 @@ bi_register_allocate(bi_context *ctx)
                         if (spill_node == -1)
                                 unreachable("Failed to choose spill node\n");
 
+                        /* By default, we use packed TLS addressing on Valhall.
+                         * We cannot cross 16 byte boundaries with packed TLS
+                         * addressing. Align to ensure this doesn't happen. This
+                         * could be optimized a bit.
+                         */
+                        if (ctx->arch >= 9)
+                                spill_count = ALIGN_POT(spill_count, 16);
+
                         spill_count += bi_spill_register(ctx,
                                         bi_node_to_index(spill_node, bi_max_temp(ctx)),
                                         spill_count);