From 084863bb5df35097bd071006dc0de879afef5ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Fri, 26 Feb 2021 14:56:06 +0100 Subject: [PATCH] nir: Fix unsigned upper bound of local_invocation_index for non-CS stages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_range_analysis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_range_analysis.c b/src/compiler/nir/nir_range_analysis.c index 0baf31a6f5a..d021f4a5f12 100644 --- a/src/compiler/nir/nir_range_analysis.c +++ b/src/compiler/nir/nir_range_analysis.c @@ -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] *