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 <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6668>
This commit is contained in:
Jesse Natalie
2020-09-08 17:58:12 -07:00
committed by Marge Bot
parent ee4cee6dbd
commit 924e27647e

View File

@@ -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;