Mesa (main): r600: Force last instruction of group when starting a new CF

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 12 12:16:41 UTC 2022


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Fri Dec 31 21:34:02 2021 +0100

r600: Force last instruction of group when starting a new CF

When emitting the AR forces splitting an ALU group, and at the same time
a new CF instruction is started, then the last instrcution in the finished
CF block might not have the "last" bit set, which results in an invalid
shader that might hang, or crash SB.
So when a new CF is started, force the last bit in the last ALU instruction.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Acked-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>

---

 src/gallium/drivers/r600/r600_asm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 565c657e7bc..f6f8bfd4898 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -1264,6 +1264,8 @@ int r600_bytecode_add_alu_type(struct r600_bytecode *bc,
 
 	/* cf can contains only alu or only vtx or only tex */
 	if (bc->cf_last == NULL || bc->force_add_cf) {
+               if (bc->cf_last && bc->cf_last->curr_bs_head)
+                  bc->cf_last->curr_bs_head->last = 1;
 		r = r600_bytecode_add_cf(bc);
 		if (r) {
 			free(nalu);



More information about the mesa-commit mailing list