From 50de3f80a807c657b317173c437f217bc7bd74da Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 11 Dec 2018 11:49:00 +1100 Subject: [PATCH] nir: rename nir_link_constant_varyings() nir_link_opt_varyings() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Reviewed-by: Eric Anholt --- 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 3561d17aaba..7bc0bd99943 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 12bbfa3220e..39041ec084b 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -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 diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index ffe2d370226..582d6b90b94 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -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 || diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 4fdc98b6cf4..9ba3fca4e0c 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 dce96ab58b6..af83a341e90 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.30.2