diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 7a07bb847bf..da9e17f29c3 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -524,7 +524,7 @@ bool mir_has_multiple_writes(compiler_context *ctx, int src); void mir_create_pipeline_registers(compiler_context *ctx); void -midgard_promote_uniforms(compiler_context *ctx, unsigned pressure); +midgard_promote_uniforms(compiler_context *ctx, unsigned promoted_count); void emit_ubo_read( diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 420c02e13f1..f59ef260d36 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -878,7 +878,7 @@ schedule_program(compiler_context *ctx) /* Number of 128-bit slots in memory we've spilled into */ unsigned spill_count = 0; - midgard_promote_uniforms(ctx, 8); + midgard_promote_uniforms(ctx, 16); mir_foreach_block(ctx, block) { midgard_pair_load_store(ctx, block); diff --git a/src/panfrost/midgard/mir_promote_uniforms.c b/src/panfrost/midgard/mir_promote_uniforms.c index 6c09fbe661e..e8da834b2fa 100644 --- a/src/panfrost/midgard/mir_promote_uniforms.c +++ b/src/panfrost/midgard/mir_promote_uniforms.c @@ -36,12 +36,8 @@ * spilling. If we spill anyway, I mean, it's a lose-lose at that point. */ void -midgard_promote_uniforms(compiler_context *ctx, unsigned register_pressure) +midgard_promote_uniforms(compiler_context *ctx, unsigned promoted_count) { - /* For our purposes, pressure is capped at the number of vec4 work - * registers, not live values which would consider spills */ - register_pressure = MAX2(register_pressure, 16); - mir_foreach_instr_global_safe(ctx, ins) { if (ins->type != TAG_LOAD_STORE_4) continue; if (!OP_IS_UBO_READ(ins->load_store.op)) continue; @@ -61,8 +57,7 @@ midgard_promote_uniforms(compiler_context *ctx, unsigned register_pressure) /* Check if it's a promotable range */ unsigned uniform_reg = 23 - address; - if (address > 16) continue; - if (register_pressure > uniform_reg) continue; + if (address >= promoted_count) continue; /* It is, great! Let's promote */