pan/bi: Assert that blend shaders may not spill
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 3 May 2022 21:14:20 +0000 (17:14 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 4 May 2022 12:48:27 +0000 (12:48 +0000)
The set of blend shaders is closed. They are completely internal. As such, we
know that the registers we reserve for them suffice, and we don't permit
register spilling. Refusing to support spilling in blend shaders simplifies a
number of parts of the compiler. Add a check that we don't try to spill anyway,
which will silently fail.

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 4a15b56..231fe93 100644 (file)
@@ -595,6 +595,9 @@ bi_register_allocate(bi_context *ctx)
                         if (spill_node == -1)
                                 unreachable("Failed to choose spill node\n");
 
+                        if (ctx->inputs->is_blend)
+                                unreachable("Blend shaders may not spill");
+
                         /* 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