st/mesa: don't use ** in the st_nir_link_shaders signature
authorMarek Olšák <marek.olsak@amd.com>
Sat, 23 Nov 2019 00:31:46 +0000 (19:31 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 26 Nov 2019 20:14:10 +0000 (15:14 -0500)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/state_tracker/st_glsl_to_nir.cpp

index 343b2400eb31bde170b30262159fd01228a78e9b..c7a1e12530d6fec506887957d85a6979afda40ef 100644 (file)
@@ -538,37 +538,37 @@ st_nir_vectorize_io(nir_shader *producer, nir_shader *consumer)
 }
 
 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);
    }
 }
 
@@ -718,8 +718,8 @@ st_link_nir(struct gl_context *ctx,
     * 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++) {