nir: rename nir_lower_io_arrays_to_elements -> nir_lower_io_array_vars_to_elements

same for *_no_indirects

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35760>
This commit is contained in:
Marek Olšák 2025-06-25 19:03:10 -04:00 committed by Marge Bot
parent 3713e2d580
commit 1e03827c77
10 changed files with 19 additions and 19 deletions

View file

@ -1192,7 +1192,7 @@ radv_link_shaders(const struct radv_device *device, struct radv_shader_stage *pr
NIR_PASS(_, producer, nir_lower_array_deref_of_vec, nir_var_shader_out, NULL, array_deref_of_vec_options);
NIR_PASS(_, consumer, nir_lower_array_deref_of_vec, nir_var_shader_in, NULL, array_deref_of_vec_options);
nir_lower_io_arrays_to_elements(producer, consumer);
nir_lower_io_array_vars_to_elements(producer, consumer);
nir_validate_shader(producer, "after nir_lower_io_arrays_to_elements");
nir_validate_shader(consumer, "after nir_lower_io_arrays_to_elements");

View file

@ -933,7 +933,7 @@ static void
lower_fs_io(nir_shader *nir)
{
/* Our backend doesn't handle array fragment shader outputs */
NIR_PASS(_, nir, nir_lower_io_arrays_to_elements_no_indirects, false);
NIR_PASS(_, nir, nir_lower_io_array_vars_to_elements_no_indirects, false);
NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_shader_out, NULL);
nir_assign_io_var_locations(nir, nir_var_shader_in, &nir->num_inputs,
@ -949,7 +949,7 @@ lower_fs_io(nir_shader *nir)
static void
lower_gs_io(struct nir_shader *nir)
{
NIR_PASS(_, nir, nir_lower_io_arrays_to_elements_no_indirects, false);
NIR_PASS(_, nir, nir_lower_io_array_vars_to_elements_no_indirects, false);
nir_assign_io_var_locations(nir, nir_var_shader_in, &nir->num_inputs,
MESA_SHADER_GEOMETRY);
@ -961,7 +961,7 @@ lower_gs_io(struct nir_shader *nir)
static void
lower_vs_io(struct nir_shader *nir)
{
NIR_PASS(_, nir, nir_lower_io_arrays_to_elements_no_indirects, false);
NIR_PASS(_, nir, nir_lower_io_array_vars_to_elements_no_indirects, false);
nir_assign_io_var_locations(nir, nir_var_shader_in, &nir->num_inputs,
MESA_SHADER_VERTEX);
@ -1748,7 +1748,7 @@ link_shaders(nir_shader *producer, nir_shader *consumer)
NIR_PASS(_, consumer, nir_lower_io_vars_to_scalar, nir_var_shader_in);
}
nir_lower_io_arrays_to_elements(producer, consumer);
nir_lower_io_array_vars_to_elements(producer, consumer);
v3d_optimize_nir(NULL, producer);
v3d_optimize_nir(NULL, consumer);

View file

@ -187,7 +187,7 @@ else
'nir_lower_interpolation.c',
'nir_lower_int_to_float.c',
'nir_lower_io.c',
'nir_lower_io_arrays_to_elements.c',
'nir_lower_io_array_vars_to_elements.c',
'nir_lower_io_to_temporaries.c',
'nir_lower_io_to_scalar.c',
'nir_lower_io_vars_to_scalar.c',

View file

@ -5304,9 +5304,9 @@ bool nir_lower_int_to_float(nir_shader *shader);
bool nir_lower_load_const_to_scalar(nir_shader *shader);
bool nir_lower_read_invocation_to_scalar(nir_shader *shader);
bool nir_lower_phis_to_scalar(nir_shader *shader, bool lower_all);
void nir_lower_io_arrays_to_elements(nir_shader *producer, nir_shader *consumer);
bool nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
bool outputs_only);
void nir_lower_io_array_vars_to_elements(nir_shader *producer, nir_shader *consumer);
bool nir_lower_io_array_vars_to_elements_no_indirects(nir_shader *shader,
bool outputs_only);
bool nir_lower_io_to_scalar(nir_shader *shader, nir_variable_mode mask, nir_instr_filter_cb filter, void *filter_data);
bool nir_lower_io_vars_to_scalar(nir_shader *shader, nir_variable_mode mask);
bool nir_opt_vectorize_io_vars(nir_shader *shader, nir_variable_mode mask);

View file

@ -25,7 +25,7 @@
#include "nir_builder.h"
#include "nir_deref.h"
/** @file nir_lower_io_arrays_to_elements.c
/** @file nir_lower_io_array_vars_to_elements.c
*
* Split arrays/matrices with direct indexing into individual elements. This
* will allow optimisation passes to better clean up unused elements.
@ -356,8 +356,8 @@ lower_io_arrays_to_elements(nir_shader *shader, nir_variable_mode mask,
}
bool
nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
bool outputs_only)
nir_lower_io_array_vars_to_elements_no_indirects(nir_shader *shader,
bool outputs_only)
{
struct hash_table *split_inputs = _mesa_pointer_hash_table_create(NULL);
struct hash_table *split_outputs = _mesa_pointer_hash_table_create(NULL);
@ -396,7 +396,7 @@ nir_lower_io_arrays_to_elements_no_indirects(nir_shader *shader,
}
void
nir_lower_io_arrays_to_elements(nir_shader *producer, nir_shader *consumer)
nir_lower_io_array_vars_to_elements(nir_shader *producer, nir_shader *consumer)
{
struct hash_table *split_inputs = _mesa_pointer_hash_table_create(NULL);
struct hash_table *split_outputs = _mesa_pointer_hash_table_create(NULL);

View file

@ -6241,7 +6241,7 @@ zink_shader_init(struct zink_screen *screen, struct zink_shader *zs)
if (nir->info.stage == MESA_SHADER_TESS_CTRL ||
nir->info.stage == MESA_SHADER_TESS_EVAL)
NIR_PASS(_, nir, nir_lower_io_arrays_to_elements_no_indirects, false);
NIR_PASS(_, nir, nir_lower_io_array_vars_to_elements_no_indirects, false);
if (nir->info.stage < MESA_SHADER_FRAGMENT)
have_psiz = check_psiz(nir);

View file

@ -424,9 +424,9 @@ lvp_shader_lower(struct lvp_device *pdevice, nir_shader *nir, struct lvp_pipelin
if (nir->info.stage == MESA_SHADER_VERTEX ||
nir->info.stage == MESA_SHADER_GEOMETRY) {
NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false);
NIR_PASS_V(nir, nir_lower_io_array_vars_to_elements_no_indirects, false);
} else if (nir->info.stage == MESA_SHADER_FRAGMENT) {
NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, true);
NIR_PASS_V(nir, nir_lower_io_array_vars_to_elements_no_indirects, true);
}
// TODO: also optimize the tex srcs. see radeonSI for reference */

View file

@ -1485,7 +1485,7 @@ brw_nir_link_shaders(const struct brw_compiler *compiler,
NIR_PASS(_, consumer, brw_nir_zero_inputs, &zero_inputs);
}
nir_lower_io_arrays_to_elements(producer, consumer);
nir_lower_io_array_vars_to_elements(producer, consumer);
nir_validate_shader(producer, "after nir_lower_io_arrays_to_elements");
nir_validate_shader(consumer, "after nir_lower_io_arrays_to_elements");

View file

@ -1144,7 +1144,7 @@ elk_nir_link_shaders(const struct elk_compiler *compiler,
{
const struct intel_device_info *devinfo = compiler->devinfo;
nir_lower_io_arrays_to_elements(producer, consumer);
nir_lower_io_array_vars_to_elements(producer, consumer);
nir_validate_shader(producer, "after nir_lower_io_arrays_to_elements");
nir_validate_shader(consumer, "after nir_lower_io_arrays_to_elements");

View file

@ -1025,7 +1025,7 @@ dxil_spirv_nir_passes(nir_shader *nir,
NIR_PASS_V(nir, nir_lower_global_vars_to_local);
NIR_PASS_V(nir, nir_split_var_copies);
NIR_PASS_V(nir, nir_lower_var_copies);
NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false);
NIR_PASS_V(nir, nir_lower_io_array_vars_to_elements_no_indirects, false);
if (conf->yz_flip.mode != DXIL_SPIRV_YZ_FLIP_NONE) {