nir: Add nir_static_workgroup_size helper.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26679>
This commit is contained in:
Bas Nieuwenhuizen 2023-12-14 16:43:23 +01:00 committed by Marge Bot
parent 21d569b081
commit bc99b73d70
2 changed files with 10 additions and 0 deletions

View file

@ -3406,3 +3406,10 @@ nir_remove_non_exported(nir_shader *nir)
exec_node_remove(&func->node);
}
}
unsigned
nir_static_workgroup_size(const nir_shader *s)
{
return s->info.workgroup_size[0] * s->info.workgroup_size[1] *
s->info.workgroup_size[2];
}

View file

@ -6515,6 +6515,9 @@ nir_remove_tex_shadow(nir_shader *shader, unsigned textures_bitmask);
void
nir_trivialize_registers(nir_shader *s);
unsigned
nir_static_workgroup_size(const nir_shader *s);
static inline nir_intrinsic_instr *
nir_reg_get_decl(nir_def *reg)
{