From 1ec172646cd7f5b8c04173a6b45a871aa48aa12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Tue, 15 Nov 2022 13:33:19 +0100 Subject: [PATCH] r300: more informative too many ALU instructions error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Ondračka Reviewed-by: Filip Gawin Tested-by: Filip Gawin Reviewed-by: Emma Anholt Part-of: --- src/gallium/drivers/r300/compiler/r300_fragprog_emit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c b/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c index 1aac64b0159..5d2b95627cc 100644 --- a/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c +++ b/src/gallium/drivers/r300/compiler/r300_fragprog_emit.c @@ -157,7 +157,11 @@ static int emit_alu(struct r300_emit_state * emit, struct rc_pair_instruction* i PROG_CODE; if (code->alu.length >= c->Base.max_alu_insts) { - error("Too many ALU instructions"); + /* rc_recompute_ips does not give an exact count, because it counts extra stuff + * like BEGINTEX, but here it is intended to be only approximative anyway, + * just to give some idea how close to the limit we are. */ + rc_error(&c->Base, "Too many ALU instructions used: %u, max: %u.\n", + rc_recompute_ips(&c->Base), c->Base.max_alu_insts); return 0; }