}
static void
-st_nir_link_shaders(nir_shader **producer, nir_shader **consumer)
+st_nir_link_shaders(nir_shader *producer, nir_shader *consumer)
{
- if ((*producer)->options->lower_to_scalar) {
- NIR_PASS_V(*producer, nir_lower_io_to_scalar_early, nir_var_shader_out);
- NIR_PASS_V(*consumer, nir_lower_io_to_scalar_early, nir_var_shader_in);
+ if (producer->options->lower_to_scalar) {
+ NIR_PASS_V(producer, nir_lower_io_to_scalar_early, nir_var_shader_out);
+ NIR_PASS_V(consumer, nir_lower_io_to_scalar_early, nir_var_shader_in);
}
- nir_lower_io_arrays_to_elements(*producer, *consumer);
+ nir_lower_io_arrays_to_elements(producer, consumer);
- st_nir_opts(*producer);
- st_nir_opts(*consumer);
+ st_nir_opts(producer);
+ st_nir_opts(consumer);
- if (nir_link_opt_varyings(*producer, *consumer))
- st_nir_opts(*consumer);
+ if (nir_link_opt_varyings(producer, consumer))
+ st_nir_opts(consumer);
- NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out);
- NIR_PASS_V(*consumer, nir_remove_dead_variables, nir_var_shader_in);
+ NIR_PASS_V(producer, nir_remove_dead_variables, nir_var_shader_out);
+ NIR_PASS_V(consumer, nir_remove_dead_variables, nir_var_shader_in);
- if (nir_remove_unused_varyings(*producer, *consumer)) {
- NIR_PASS_V(*producer, nir_lower_global_vars_to_local);
- NIR_PASS_V(*consumer, nir_lower_global_vars_to_local);
+ if (nir_remove_unused_varyings(producer, consumer)) {
+ NIR_PASS_V(producer, nir_lower_global_vars_to_local);
+ NIR_PASS_V(consumer, nir_lower_global_vars_to_local);
- st_nir_opts(*producer);
- st_nir_opts(*consumer);
+ st_nir_opts(producer);
+ st_nir_opts(consumer);
/* Optimizations can cause varyings to become unused.
* nir_compact_varyings() depends on all dead varyings being removed so
* we need to call nir_remove_dead_variables() again here.
*/
- NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out);
- NIR_PASS_V(*consumer, nir_remove_dead_variables, nir_var_shader_in);
+ NIR_PASS_V(producer, nir_remove_dead_variables, nir_var_shader_out);
+ NIR_PASS_V(consumer, nir_remove_dead_variables, nir_var_shader_in);
}
}
* stage.
*/
for (int i = num_shaders - 2; i >= 0; i--) {
- st_nir_link_shaders(&linked_shader[i]->Program->nir,
- &linked_shader[i + 1]->Program->nir);
+ st_nir_link_shaders(linked_shader[i]->Program->nir,
+ linked_shader[i + 1]->Program->nir);
}
for (unsigned i = 0; i < num_shaders; i++) {