intel/compiler: Use nir_static_workgroup_size helper

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40843>
This commit is contained in:
Kenneth Graunke 2026-04-06 16:36:28 -07:00 committed by Marge Bot
parent 82b3db7e06
commit cac9f670d1
2 changed files with 6 additions and 12 deletions

View file

@ -3436,12 +3436,9 @@ lower_simd(nir_builder *b, nir_instr *instr, void *options)
/* If the whole workgroup fits in one thread, we can lower subgroup_id
* to a constant zero.
*/
if (!b->shader->info.workgroup_size_variable) {
unsigned local_workgroup_size = b->shader->info.workgroup_size[0] *
b->shader->info.workgroup_size[1] *
b->shader->info.workgroup_size[2];
if (local_workgroup_size <= simd_width)
return nir_imm_int(b, 0);
if (!b->shader->info.workgroup_size_variable &&
nir_static_workgroup_size(b->shader) <= simd_width) {
return nir_imm_int(b, 0);
}
return NULL;

View file

@ -6900,12 +6900,9 @@ lower_simd(nir_builder *b, nir_instr *instr, void *options)
/* If the whole workgroup fits in one thread, we can lower subgroup_id
* to a constant zero.
*/
if (!b->shader->info.workgroup_size_variable) {
unsigned local_workgroup_size = b->shader->info.workgroup_size[0] *
b->shader->info.workgroup_size[1] *
b->shader->info.workgroup_size[2];
if (local_workgroup_size <= simd_width)
return nir_imm_int(b, 0);
if (!b->shader->info.workgroup_size_variable &&
nir_static_workgroup_size(b->shader) <= simd_width) {
return nir_imm_int(b, 0);
}
return NULL;