Mesa (master): r600/sfn: Keep array registers alive for the whole shader

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 20 12:19:15 UTC 2021


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Mon Jan 18 13:02:44 2021 +0100

r600/sfn: Keep array registers alive for the whole shader

This is needed when using sb as a post-optimizer.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8563>

---

 src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp b/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp
index b818cd3d498..c53b3252788 100644
--- a/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp
@@ -279,8 +279,16 @@ GPRArray::GPRArray(int base, int size, int mask, int frac):
    m_values.resize(size);
    for (int i = 0; i < size; ++i) {
       for (int j = 0; j < 4; ++j) {
-         if (mask & (1 << j))
-            m_values[i].set_reg_i(j, PValue(new GPRValue(base + i, j)));
+         if (mask & (1 << j)) {
+            auto gpr = new GPRValue(base + i, j);
+            /* If we want to use sb, we have to keep arrays
+             * alife for the whole shader range, otherwise the sb scheduler
+             * thinks is not capable to rename non-array uses of these registers */
+            gpr->set_as_input();
+            gpr->set_keep_alive();
+            m_values[i].set_reg_i(j, PValue(gpr));
+
+         }
       }
    }
 }



More information about the mesa-commit mailing list