ir3: Fix barrier error case calculation

Make waves_per_wg actually be the waves per workgroup, so that the
condition below for when we should error out actually is correct.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39463>
This commit is contained in:
Connor Abbott 2026-01-22 13:58:13 -05:00 committed by Marge Bot
parent f3c53cf66b
commit b95839b9c9

View file

@ -277,15 +277,15 @@ ir3_get_reg_independent_max_waves(struct ir3_shader_variant *v,
unsigned waves_per_wg =
DIV_ROUND_UP(threads_per_wg, compiler->info->threadsize_base *
(double_threadsize ? 2 : 1) *
compiler->info->wave_granularity);
compiler->info->wave_granularity) *
compiler->info->wave_granularity;
/* Shared is allocated in chunks of 1k */
unsigned shared_per_wg = ALIGN_POT(v->shared_size, 1024);
if (shared_per_wg > 0 && !v->local_size_variable) {
unsigned wgs_per_core = compiler->info->cs_shared_mem_size / shared_per_wg;
max_waves = MIN2(max_waves, waves_per_wg * wgs_per_core *
compiler->info->wave_granularity);
max_waves = MIN2(max_waves, waves_per_wg * wgs_per_core);
}
/* If we have a compute shader that has a big workgroup, a barrier, and