agx: Don't wait at the end of the shader

This is totally pointless. This saves some waits at the ends of compute kernels
(waiting for stores to complete before terminating the thread). I don't know
how much this would matter for performance, since the hardware may have to do
these waits internally, but it makes the generated code less silly which is
always nice.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22891>
This commit is contained in:
Alyssa Rosenzweig
2023-04-25 23:20:25 -04:00
parent 3d138f4460
commit 31c805d0aa
+10 -5
View File
@@ -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);
}
}
}