From d920200ad65c7fdec660af1388cdcb99b172a017 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Fri, 31 Dec 2021 21:34:02 +0100 Subject: [PATCH] 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 Acked-by: Emma Anholt Part-of: --- 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);