mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 00:38:48 +02:00
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:
parent
82b3db7e06
commit
cac9f670d1
2 changed files with 6 additions and 12 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue