ralloc_free(b);
- /* Because we can still have output reads in NIR, we need to lower
- * outputs to temporaries before we are truely finished.
- */
- nir_lower_outputs_to_temporaries(entry_point->shader, entry_point);
-
return entry_point;
}
assert(exec_list_length(&nir->functions) == 1);
entry_point->name = ralloc_strdup(entry_point, "main");
+ nir_remove_dead_variables(nir, nir_var_shader_in);
+ nir_remove_dead_variables(nir, nir_var_shader_out);
+ nir_remove_dead_variables(nir, nir_var_system_value);
+ nir_validate_shader(nir);
+
+ nir_lower_outputs_to_temporaries(entry_point->shader, entry_point);
+
nir_lower_system_values(nir);
nir_validate_shader(nir);
}