running nir_lower_io_arrays_to_elements_no_indirects for only some stages
breaks location-setting for the stages which don't run it when
e.g., dmat2x3 variables are sometimes split across locations and
sometimes jammed into a single location (TCS I'm looking at you)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
if (nir->info.stage == MESA_SHADER_VERTEX)
create_vs_pushconst(nir);
+ else if (nir->info.stage == MESA_SHADER_TESS_CTRL ||
+ nir->info.stage == MESA_SHADER_TESS_EVAL) {
+ NIR_PASS_V(nir, nir_lower_indirect_derefs, nir_var_shader_in | nir_var_shader_out, UINT_MAX);
+ NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false);
+ }
/* only do uniforms -> ubo if we have uniforms, otherwise we're just
* screwing with the bindings for no reason