Mesa (master): broadcom/compiler: disallow spilling if TMU pipelining was enabled

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 4 11:09:20 UTC 2021


Module: Mesa
Branch: master
Commit: 0f90b729fb04a3d8a9c341e289b831a287a7dd8e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f90b729fb04a3d8a9c341e289b831a287a7dd8e

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Tue Feb  2 09:20:47 2021 +0100

broadcom/compiler: disallow spilling if TMU pipelining was enabled

TMU pipelining makes TMU spilling difficult and can easily lead to
doing large amounts of spills to compile a shader. It is best to
only use pipelining if we can compile without spilling.

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8825>

---

 src/broadcom/compiler/vir_register_allocate.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/broadcom/compiler/vir_register_allocate.c b/src/broadcom/compiler/vir_register_allocate.c
index 1be36ccbace..6b4e947eb9c 100644
--- a/src/broadcom/compiler/vir_register_allocate.c
+++ b/src/broadcom/compiler/vir_register_allocate.c
@@ -737,9 +737,12 @@ v3d_register_allocate(struct v3d_compile *c, bool *spilled)
                                 break;
 
                         /* Don't emit spills using the TMU until we've dropped
-                         * thread count first.
+                         * thread count first. Also, don't spill if we have
+                         * enabled TMU pipelining, as that can make TMU spilling
+                         * pretty terrible.
                          */
-                        if (is_uniform || thread_index == 0) {
+                        if (is_uniform ||
+                            (thread_index == 0 && c->disable_tmu_pipelining)) {
                                 v3d_spill_reg(c, map[node].temp);
 
                                 /* Ask the outer loop to call back in. */



More information about the mesa-commit mailing list