From 38694b73865956e8d22f47f259e5d0bb70f28245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Sun, 22 Jan 2023 16:45:00 +0100 Subject: [PATCH] r300: reduce number of iterations for vertex shader loops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the default value leads to occasional hangs on RV516 for unknown reasons. Set it to 128 insted of 255. dEQP and piglit are still happy and I don't expect any real app to hit this, but lets see. As a side effect this boosts fps in the apps that have non-unrollable vertex shaders (as the shaders now effectivelly run almost two times faster) and ~5% dEQP runtime decrease. Reviewed-by: Filip Gawin Signed-off-by: Pavel Ondračka Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7934 Part-of: --- src/gallium/drivers/r300/compiler/r3xx_vertprog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c index 4ee3b878b4c..a02147a8244 100644 --- a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c +++ b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c @@ -502,11 +502,15 @@ static void translate_vertex_program(struct radeon_compiler *c, void *user) "Too many flow control instructions."); return; } + /* Maximum of R500_PVS_FC_LOOP_CNT_JMP_INST is 0xff, here + * we reduce it to half to avoid occasional hangs on RV516 + * and downclocked RV530. + */ if (compiler->Base.is_r500) { compiler->code->fc_op_addrs.r500 [compiler->code->num_fc_ops].lw = R500_PVS_FC_ACT_ADRS(act_addr) - | R500_PVS_FC_LOOP_CNT_JMP_INST(0x00ff) + | R500_PVS_FC_LOOP_CNT_JMP_INST(0x0080) ; compiler->code->fc_op_addrs.r500 [compiler->code->num_fc_ops].uw =