Mesa (main): r300: Move the instruction filter for r500_transform_IF() to the top.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 8 02:46:11 UTC 2021


Module: Mesa
Branch: main
Commit: 42e8f48be729535449bfae3983d4350993149977
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=42e8f48be729535449bfae3983d4350993149977

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Dec  7 10:56:42 2021 -0800

r300: Move the instruction filter for r500_transform_IF() to the top.

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 <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14117>

---

 src/gallium/drivers/r300/ci/r300-rv515-skips.txt  | 3 ---
 src/gallium/drivers/r300/compiler/r500_fragprog.c | 7 +++----
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r300/ci/r300-rv515-skips.txt b/src/gallium/drivers/r300/ci/r300-rv515-skips.txt
index 85b4c5ca9db..9675f2ab4c0 100644
--- a/src/gallium/drivers/r300/ci/r300-rv515-skips.txt
+++ b/src/gallium/drivers/r300/ci/r300-rv515-skips.txt
@@ -4,6 +4,3 @@
 # Timeouts
 KHR-GLES2.texture_3d.filtering.combinations.*linear_mipmap_linear
 KHR-GLES2.texture_3d.filtering.sizes.*linear_mipmap_linear
-
-# Infinite? looping in r500_transform_IF()
-dEQP-GLES2.functional.shaders.indexing.tmp_array.*_const_write_dynamic_read_fragment
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) {



More information about the mesa-commit mailing list