From 14fe19e7976b217e2d59e44ab3ffdf5d267b190a Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 18 Jan 2021 13:02:44 +0100 Subject: [PATCH] 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 Part-of: --- 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)); + + } } } }