nvk: Do not set lower_cs_local_index_to_id

With task/mesh shaders, we need that lowering to not happen.

Move to conditionally lower local invocation index with
nir_lower_compute_system_values_options in case of compute shader.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27196>
This commit is contained in:
Mary Guillemard 2026-02-05 21:14:05 +01:00 committed by Marge Bot
parent 50b3ae08e7
commit 424c466cdb
2 changed files with 5 additions and 2 deletions

View file

@ -139,7 +139,6 @@ fn nir_options(dev: &nv_device_info) -> nir_shader_compiler_options {
lower_unpack_snorm_4x8: true,
lower_insert_byte: true,
lower_insert_word: true,
lower_cs_local_index_to_id: true,
lower_device_index_to_zero: true,
lower_isign: true,
lower_uadd_sat: dev.sm < 70,

View file

@ -383,6 +383,7 @@ nvk_lower_nir(struct nvk_device *dev, nir_shader *nir,
nir_lower_compute_system_values_options csv_options = {
.has_base_workgroup_id = true,
.lower_local_invocation_index = mesa_shader_stage_is_compute(nir->info.stage),
};
NIR_PASS(_, nir, nir_lower_compute_system_values, &csv_options);
@ -477,7 +478,10 @@ nvk_lower_nir(struct nvk_device *dev, nir_shader *nir,
* nir_zero_initialize_shared_memory generates load_invocation_id which
* has to be lowered to load_invocation_index.
*/
NIR_PASS(_, nir, nir_lower_compute_system_values, NULL);
nir_lower_compute_system_values_options csv_options = {
.lower_local_invocation_index = mesa_shader_stage_is_compute(nir->info.stage),
};
NIR_PASS(_, nir, nir_lower_compute_system_values, &csv_options);
}
}