NIR_PASS_V(nir, nir_lower_system_values);
NIR_PASS_V(nir, nir_lower_compute_system_values, NULL);
+ /* si_nir_kill_outputs and ac_nir_optimize_outputs require outputs to be scalar. */
+ if (nir->info.stage == MESA_SHADER_VERTEX ||
+ nir->info.stage == MESA_SHADER_TESS_EVAL ||
+ nir->info.stage == MESA_SHADER_GEOMETRY)
+ NIR_PASS_V(nir, nir_lower_io_to_scalar, nir_var_shader_out);
+
if (nir->info.stage == MESA_SHADER_COMPUTE) {
if (nir->info.cs.derivative_group == DERIVATIVE_GROUP_QUADS) {
/* If we are shuffling local_invocation_id for quad derivatives, we