From 94449816abefc0d7b03e8b65ff545cf3f7fcfcba Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 7 Dec 2021 10:56:42 -0800 Subject: [PATCH] r300: Move the instruction filter for r500_transform_IF() to the top. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rc_get_variables() is slow, don't call it if we're going to just exit immediately anyway. Cc: mesa-stable Reviewed-by: Marek Olšák Part-of: (cherry picked from commit 42e8f48be729535449bfae3983d4350993149977) --- .pick_status.json | 2 +- src/gallium/drivers/r300/compiler/r500_fragprog.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 557f7d8e3b0..4208e02118f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4567,7 +4567,7 @@ "description": "r300: Move the instruction filter for r500_transform_IF() to the top.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/r300/compiler/r500_fragprog.c b/src/gallium/drivers/r300/compiler/r500_fragprog.c index 6be615f33d4..35dab9828c0 100644 --- a/src/gallium/drivers/r300/compiler/r500_fragprog.c +++ b/src/gallium/drivers/r300/compiler/r500_fragprog.c @@ -44,16 +44,15 @@ int r500_transform_IF( struct rc_instruction * inst_if, void *data) { + if (inst_if->U.I.Opcode != RC_OPCODE_IF) + return 0; + struct rc_variable * writer; struct rc_list * writer_list, * list_ptr; struct rc_list * var_list = rc_get_variables(c); unsigned int generic_if = 0; unsigned int alu_chan; - if (inst_if->U.I.Opcode != RC_OPCODE_IF) { - return 0; - } - writer_list = rc_variable_list_get_writers( var_list, inst_if->Type, &inst_if->U.I.SrcReg[0]); if (!writer_list) {