Mesa (main): r300/vs: Fix flow control processing just after an endloop.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 21 01:33:58 UTC 2021


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

Author: Emma Anholt <emma at anholt.net>
Date:   Mon Dec 20 12:48:15 2021 -0800

r300/vs: Fix flow control processing just after an endloop.

We tried to step over the instruction we just generated, except we didn't
always just generate one.  In the sequence_vertex tests, that meant we
skipped processing the next BGNLOOP and then underflowed our stack.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14271>

---

 src/gallium/drivers/r300/ci/r300-rv515-fails.txt   | 9 ---------
 src/gallium/drivers/r300/compiler/radeon_vert_fc.c | 4 ++--
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/r300/ci/r300-rv515-fails.txt b/src/gallium/drivers/r300/ci/r300-rv515-fails.txt
index fe66e252e50..9263ec35926 100644
--- a/src/gallium/drivers/r300/ci/r300-rv515-fails.txt
+++ b/src/gallium/drivers/r300/ci/r300-rv515-fails.txt
@@ -64,15 +64,6 @@ dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_w
 dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_static_loop_subscript_read_fragment,Fail
 dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_static_subscript_read_fragment,Fail
 
-# Bus error
-dEQP-GLES2.functional.shaders.loops.for_dynamic_iterations.sequence_vertex,Crash
-dEQP-GLES2.functional.shaders.loops.for_uniform_iterations.sequence_vertex,Crash
-dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.sequence_vertex,Crash
-dEQP-GLES2.functional.shaders.loops.do_while_uniform_iterations.sequence_vertex,Crash
-dEQP-GLES2.functional.shaders.loops.while_constant_iterations.sequence_vertex,Crash
-dEQP-GLES2.functional.shaders.loops.while_dynamic_iterations.sequence_vertex,Crash
-dEQP-GLES2.functional.shaders.loops.while_uniform_iterations.sequence_vertex,Crash
-
 dEQP-GLES2.functional.shaders.loops.do_while_constant_iterations.mixed_break_continue_vertex,Fail
 dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.conditional_continue_vertex,Fail
 dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.double_continue_vertex,Fail
diff --git a/src/gallium/drivers/r300/compiler/radeon_vert_fc.c b/src/gallium/drivers/r300/compiler/radeon_vert_fc.c
index fded485aaa9..51ab6213f25 100644
--- a/src/gallium/drivers/r300/compiler/radeon_vert_fc.c
+++ b/src/gallium/drivers/r300/compiler/radeon_vert_fc.c
@@ -257,10 +257,10 @@ void rc_vert_fc(struct radeon_compiler *c, void *user)
 			if (fc_state.BranchDepth != 0
 					|| fc_state.LoopDepth != 1) {
 				lower_endloop(inst, &fc_state);
+				/* Skip the new PRED_RESTORE */
+				inst = inst->Next;
 			}
 			fc_state.LoopDepth--;
-			/* Skip PRED_RESTORE */
-			inst = inst->Next;
 			break;
 		case RC_OPCODE_IF:
 			lower_if(inst, &fc_state);



More information about the mesa-commit mailing list