diff --git a/src/asahi/compiler/agx_insert_waits.c b/src/asahi/compiler/agx_insert_waits.c index 3ac4ea78f95..355455e0224 100644 --- a/src/asahi/compiler/agx_insert_waits.c +++ b/src/asahi/compiler/agx_insert_waits.c @@ -84,6 +84,16 @@ agx_insert_waits_local(agx_context *ctx, agx_block *block) } } + /* Check for barriers */ + if (I->op == AGX_OPCODE_THREADGROUP_BARRIER || + I->op == AGX_OPCODE_MEMORY_BARRIER) { + + for (unsigned slot = 0; slot < ARRAY_SIZE(slots); ++slot) { + if (slots[slot].nr_pending) + wait_mask |= BITSET_BIT(slot); + } + } + /* Try to assign a free slot */ if (instr_is_async(I)) { for (unsigned slot = 0; slot < ARRAY_SIZE(slots); ++slot) {