mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 18:50:10 +01:00
pan/mdg: Emit a tilebuffer wait loop when needed
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
This commit is contained in:
parent
1e1eee992e
commit
ed4d2739fe
1 changed files with 20 additions and 1 deletions
|
|
@ -2478,7 +2478,7 @@ emit_fragment_epilogue(compiler_context *ctx, unsigned rt)
|
|||
}
|
||||
|
||||
static midgard_block *
|
||||
emit_block(compiler_context *ctx, nir_block *block)
|
||||
emit_block_init(compiler_context *ctx)
|
||||
{
|
||||
midgard_block *this_block = ctx->after_block;
|
||||
ctx->after_block = NULL;
|
||||
|
|
@ -2495,6 +2495,14 @@ emit_block(compiler_context *ctx, nir_block *block)
|
|||
list_inithead(&this_block->base.instructions);
|
||||
ctx->current_block = this_block;
|
||||
|
||||
return this_block;
|
||||
}
|
||||
|
||||
static midgard_block *
|
||||
emit_block(compiler_context *ctx, nir_block *block)
|
||||
{
|
||||
midgard_block *this_block = emit_block_init(ctx);
|
||||
|
||||
nir_foreach_instr(instr, block) {
|
||||
emit_instr(ctx, instr);
|
||||
++ctx->instruction_count;
|
||||
|
|
@ -2791,6 +2799,17 @@ midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_b
|
|||
ctx->func = func;
|
||||
ctx->already_emitted = calloc(BITSET_WORDS(func->impl->ssa_alloc), sizeof(BITSET_WORD));
|
||||
|
||||
if (nir->info.outputs_read && !is_blend) {
|
||||
emit_block_init(ctx);
|
||||
|
||||
struct midgard_instruction wait = v_branch(false, false);
|
||||
wait.branch.target_type = TARGET_TILEBUF_WAIT;
|
||||
|
||||
emit_mir_instruction(ctx, wait);
|
||||
|
||||
++ctx->instruction_count;
|
||||
}
|
||||
|
||||
emit_cf_list(ctx, &func->impl->body);
|
||||
free(ctx->already_emitted);
|
||||
break; /* TODO: Multi-function shaders */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue