ir3: Add bar to beginning of HS with tess_use_shared

This matches the blob. In theory, this is necessary only because the
VS/HS workgroup can now span more than one wave and a patch may be
assigned to different waves in the VS and HS. However I've seen it fix
tests where the entire draw should fit in one wave, so there may some
other sort of waiting this does or the HW dispatch may be inefficient
sometimes.

Fixes
EQP-VK.tessellation.user_defined_io.per_patch.vertex_io_array_size_implicit.*
when run immediately after
dEQP-VK.tessellation.invariance.outer_triangle_set.quads_fractional_even_spacing
or when all of dEQP-VK.tessellation.* is run in sequence on a650.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12791>
This commit is contained in:
Connor Abbott 2021-09-09 14:16:08 +02:00 committed by Marge Bot
parent 6c286edc53
commit 9033916d84
1 changed files with 9 additions and 0 deletions

View File

@ -3805,6 +3805,15 @@ emit_instructions(struct ir3_context *ctx)
nir_foreach_register (reg, &fxn->registers) {
ir3_declare_array(ctx, reg);
}
if (ctx->so->type == MESA_SHADER_TESS_CTRL &&
ctx->compiler->tess_use_shared) {
struct ir3_instruction *barrier = ir3_BAR(ctx->block);
barrier->flags = IR3_INSTR_SS | IR3_INSTR_SY;
barrier->barrier_class = IR3_BARRIER_EVERYTHING;
array_insert(ctx->block, ctx->block->keeps, barrier);
}
/* And emit the body: */
ctx->impl = fxn;
emit_function(ctx, fxn);