From: Jesse Natalie Date: Wed, 9 Sep 2020 00:58:12 +0000 (-0700) Subject: nir_lower_system_values: Fix load_global_invocation_id to use base_work_group_id... X-Git-Tag: upstream/21.0.0~5167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=924e27647e47d51111bca12bce470aba4fd85e37;p=platform%2Fupstream%2Fmesa.git nir_lower_system_values: Fix load_global_invocation_id to use base_work_group_id even with no base_global id Reviewed-by: Karol Herbst Part-of: --- diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c index b99f655..cf06cea 100644 --- a/src/compiler/nir/nir_lower_system_values.c +++ b/src/compiler/nir/nir_lower_system_values.c @@ -351,7 +351,8 @@ lower_compute_system_value_instr(nir_builder *b, if (options && options->has_base_global_invocation_id) return nir_iadd(b, nir_load_global_invocation_id_zero_base(b, bit_size), nir_load_base_global_invocation_id(b, bit_size)); - else if (!b->shader->options->has_cs_global_id) + else if ((options && options->has_base_work_group_id) || + !b->shader->options->has_cs_global_id) return nir_load_global_invocation_id_zero_base(b, bit_size); else return NULL;