diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index a341b3a772369..1802fdec8edf8 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -627,8 +627,10 @@ st_link_glsl_to_nir(struct gl_context *ctx, NIR_PASS(_, nir, st_nir_lower_wpos_ytransform, shader->Program, st->screen); + /* needed to lower base_workgroup_id and base_global_invocation_id */ + struct nir_lower_compute_system_values_options cs_options = {}; NIR_PASS(_, nir, nir_lower_system_values); - NIR_PASS(_, nir, nir_lower_compute_system_values, NULL); + NIR_PASS(_, nir, nir_lower_compute_system_values, &cs_options); if (nir->info.io_lowered) continue; /* the rest is for non-lowered IO only */ diff --git a/src/mesa/state_tracker/st_nir_builtins.c b/src/mesa/state_tracker/st_nir_builtins.c index 776ceda04c1f6..be4dfdb2b63b3 100644 --- a/src/mesa/state_tracker/st_nir_builtins.c +++ b/src/mesa/state_tracker/st_nir_builtins.c @@ -43,7 +43,12 @@ st_nir_finish_builtin_nir(struct st_context *st, nir_shader *nir) NIR_PASS(_, nir, nir_split_var_copies); NIR_PASS(_, nir, nir_lower_var_copies); NIR_PASS(_, nir, nir_lower_system_values); - NIR_PASS(_, nir, nir_lower_compute_system_values, NULL); + + struct nir_lower_compute_system_values_options cs_options = { + .has_base_global_invocation_id = false, + .has_base_workgroup_id = false, + }; + NIR_PASS(_, nir, nir_lower_compute_system_values, &cs_options); if (nir->options->lower_to_scalar) { nir_variable_mode mask = diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 32ed4a4702f17..c71a20c58a9e1 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -382,7 +382,12 @@ st_prog_to_nir_postprocess(struct st_context *st, nir_shader *nir, NIR_PASS(_, nir, st_nir_lower_wpos_ytransform, prog, screen); NIR_PASS(_, nir, nir_lower_system_values); - NIR_PASS(_, nir, nir_lower_compute_system_values, NULL); + + struct nir_lower_compute_system_values_options cs_options = { + .has_base_global_invocation_id = false, + .has_base_workgroup_id = false, + }; + NIR_PASS(_, nir, nir_lower_compute_system_values, &cs_options); /* Optimise NIR */ NIR_PASS(_, nir, nir_opt_constant_folding);