nir: Fix unsigned upper bound of local_invocation_index for non-CS stages.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9201>
This commit is contained in:
Timur Kristóf 2021-02-26 14:56:06 +01:00 committed by Marge Bot
parent 132171dc4e
commit 084863bb5d
1 changed files with 2 additions and 1 deletions

View File

@ -1275,7 +1275,8 @@ nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht,
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(scalar.def->parent_instr);
switch (intrin->intrinsic) {
case nir_intrinsic_load_local_invocation_index:
if (shader->info.cs.local_size_variable) {
if (shader->info.stage != MESA_SHADER_COMPUTE ||
shader->info.cs.local_size_variable) {
res = config->max_work_group_invocations - 1;
} else {
res = (shader->info.cs.local_size[0] *