nir/linker: rename replace_constant_input to replace_varying_input_by_constant_load
authorQiang Yu <yuq825@gmail.com>
Wed, 29 Sep 2021 07:22:33 +0000 (15:22 +0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 13 Oct 2021 04:45:15 +0000 (04:45 +0000)
To align with replace_varying_input_by_uniform_load and better
describe what it does.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12613>

src/compiler/nir/nir_linking_helpers.c

index b32fee2..bc1ee4d 100644 (file)
@@ -1005,7 +1005,8 @@ can_replace_varying(nir_variable *out_var)
 }
 
 static bool
-replace_constant_input(nir_shader *shader, nir_intrinsic_instr *store_intr)
+replace_varying_input_by_constant_load(nir_shader *shader,
+                                       nir_intrinsic_instr *store_intr)
 {
    nir_function_impl *impl = nir_shader_get_entrypoint(shader);
 
@@ -1354,7 +1355,7 @@ nir_link_opt_varyings(nir_shader *producer, nir_shader *consumer)
       nir_ssa_scalar uni_scalar;
       nir_ssa_def *ssa = intr->src[1].ssa;
       if (ssa->parent_instr->type == nir_instr_type_load_const) {
-         progress |= replace_constant_input(consumer, intr);
+         progress |= replace_varying_input_by_constant_load(consumer, intr);
       } else if (is_direct_uniform_load(ssa, &uni_scalar)) {
          progress |= replace_varying_input_by_uniform_load(consumer, intr,
                                                            &uni_scalar);