diff --git a/src/asahi/compiler/agx_insert_waits.c b/src/asahi/compiler/agx_insert_waits.c index 716c4a31406..3ac4ea78f95 100644 --- a/src/asahi/compiler/agx_insert_waits.c +++ b/src/asahi/compiler/agx_insert_waits.c @@ -120,11 +120,16 @@ agx_insert_waits_local(agx_context *ctx, agx_block *block) } } - /* If there are outstanding messages, wait for them */ - for (unsigned slot = 0; slot < ARRAY_SIZE(slots); ++slot) { - if (slots[slot].nr_pending) { - agx_builder b = agx_init_builder(ctx, agx_after_block_logical(block)); - agx_wait(&b, slot); + /* If there are outstanding messages, wait for them. We don't do this for the + * exit block, though, since nothing else will execute in the shader so + * waiting is pointless. + */ + if (block != agx_exit_block(ctx)) { + agx_builder b = agx_init_builder(ctx, agx_after_block_logical(block)); + + for (unsigned slot = 0; slot < ARRAY_SIZE(slots); ++slot) { + if (slots[slot].nr_pending) + agx_wait(&b, slot); } } }