nir: rename nir_link_constant_varyings() nir_link_opt_varyings()
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 11 Dec 2018 00:49:00 +0000 (11:49 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 2 Jan 2019 01:19:17 +0000 (12:19 +1100)
The following patches will add support for an additional
optimisation so this function will no longer just optimise varying
constants.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/amd/vulkan/radv_pipeline.c
src/compiler/nir/nir.h
src/compiler/nir/nir_linking_helpers.c
src/intel/compiler/brw_nir.c
src/mesa/state_tracker/st_glsl_to_nir.cpp

index 3561d17aabaa20a49740952f06c9afd5d7b11961..7bc0bd999431ca8214d6b81adcff6a275ea11fc2 100644 (file)
@@ -1814,8 +1814,8 @@ radv_link_shaders(struct radv_pipeline *pipeline, nir_shader **shaders)
                nir_lower_io_arrays_to_elements(ordered_shaders[i],
                                                ordered_shaders[i - 1]);
 
-               if (nir_link_constant_varyings(ordered_shaders[i],
-                                              ordered_shaders[i - 1]))
+               if (nir_link_opt_varyings(ordered_shaders[i],
+                                         ordered_shaders[i - 1]))
                        radv_optimize_nir(ordered_shaders[i - 1], false, false);
 
                nir_remove_dead_variables(ordered_shaders[i],
index 12bbfa3220ee493c8cde8c42da70144b452b688f..39041ec084b84291c4741c2df35a6dfd829922c4 100644 (file)
@@ -2870,7 +2870,7 @@ bool nir_remove_unused_io_vars(nir_shader *shader, struct exec_list *var_list,
 void nir_compact_varyings(nir_shader *producer, nir_shader *consumer,
                           bool default_to_smooth_interp);
 void nir_link_xfb_varyings(nir_shader *producer, nir_shader *consumer);
-bool nir_link_constant_varyings(nir_shader *producer, nir_shader *consumer);
+bool nir_link_opt_varyings(nir_shader *producer, nir_shader *consumer);
 
 typedef enum {
    /* If set, this forces all non-flat fragment shader inputs to be
index ffe2d3702264380a474e587b81b1e6349280fb01..582d6b90b94c88923594513f9ea3c7e3ec6e75e0 100644 (file)
@@ -634,7 +634,7 @@ try_replace_constant_input(nir_shader *shader,
 }
 
 bool
-nir_link_constant_varyings(nir_shader *producer, nir_shader *consumer)
+nir_link_opt_varyings(nir_shader *producer, nir_shader *consumer)
 {
    /* TODO: Add support for more shader stage combinations */
    if (consumer->info.stage != MESA_SHADER_FRAGMENT ||
index 4fdc98b6cf4b9dd4830fddd9747276e2f2394ffc..9ba3fca4e0c3f297174eae606a4f612350aab372 100644 (file)
@@ -771,7 +771,7 @@ brw_nir_link_shaders(const struct brw_compiler *compiler,
       *consumer = brw_nir_optimize(*consumer, compiler, c_is_scalar, false);
    }
 
-   if (nir_link_constant_varyings(*producer, *consumer))
+   if (nir_link_opt_varyings(*producer, *consumer))
       *consumer = brw_nir_optimize(*consumer, compiler, c_is_scalar, false);
 
    NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out);
index dce96ab58b6dd752331839e3cd10a9655d5d30f7..af83a341e90de4f802434f2cdaa8a6cc1db9453c 100644 (file)
@@ -588,7 +588,7 @@ st_nir_link_shaders(nir_shader **producer, nir_shader **consumer, bool scalar)
 {
    nir_lower_io_arrays_to_elements(*producer, *consumer);
 
-   if (nir_link_constant_varyings(*producer, *consumer))
+   if (nir_link_opt_varyings(*producer, *consumer))
       st_nir_opts(*consumer, scalar);
 
    NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out);