[Mesa-dev] [PATCH v2 2/5] nir: rename nir_link_constant_varyings() nir_link_opt_varyings()

Timothy Arceri tarceri at itsqueeze.com
Wed Dec 19 10:03:33 UTC 2018


The following patches will add support for an addition
optimisation so this function will no longer just optimise varying
constants.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
 src/amd/vulkan/radv_pipeline.c            | 4 ++--
 src/compiler/nir/nir.h                    | 2 +-
 src/compiler/nir/nir_linking_helpers.c    | 2 +-
 src/intel/compiler/brw_nir.c              | 2 +-
 src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 3561d17aab..7bc0bd9994 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -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],
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 65b51ead9f..4b8de4bb01 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2886,7 +2886,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
diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c
index 222a558b06..4f25c09d00 100644
--- a/src/compiler/nir/nir_linking_helpers.c
+++ b/src/compiler/nir/nir_linking_helpers.c
@@ -773,7 +773,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 ||
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
index ab88a5f1fc..42ecc34668 100644
--- a/src/intel/compiler/brw_nir.c
+++ b/src/intel/compiler/brw_nir.c
@@ -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);
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 5176756433..71aeec9486 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -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);
-- 
2.19.2



More information about the mesa-dev mailing list