diff --git a/src/amd/vulkan/nir/radv_nir.h b/src/amd/vulkan/nir/radv_nir.h index 0393694348e..31aa3505719 100644 --- a/src/amd/vulkan/nir/radv_nir.h +++ b/src/amd/vulkan/nir/radv_nir.h @@ -61,7 +61,7 @@ bool radv_nir_lower_viewport_to_zero(nir_shader *nir); bool radv_nir_export_multiview(nir_shader *nir); -void radv_nir_lower_io_to_scalar_early(nir_shader *nir, nir_variable_mode mask); +void radv_nir_lower_io_vars_to_scalar(nir_shader *nir, nir_variable_mode mask); unsigned radv_map_io_driver_location(unsigned semantic); diff --git a/src/amd/vulkan/nir/radv_nir_lower_io.c b/src/amd/vulkan/nir/radv_nir_lower_io.c index f0e1c5121a5..a4b03a87414 100644 --- a/src/amd/vulkan/nir/radv_nir_lower_io.c +++ b/src/amd/vulkan/nir/radv_nir_lower_io.c @@ -22,11 +22,11 @@ type_size_vec4(const struct glsl_type *type, bool bindless) } void -radv_nir_lower_io_to_scalar_early(nir_shader *nir, nir_variable_mode mask) +radv_nir_lower_io_vars_to_scalar(nir_shader *nir, nir_variable_mode mask) { bool progress = false; - NIR_PASS(progress, nir, nir_lower_io_to_scalar_early, mask); + NIR_PASS(progress, nir, nir_lower_io_vars_to_scalar, mask); if (progress) { /* Optimize the new vector code and then remove dead vars */ NIR_PASS(_, nir, nir_copy_prop); diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index 23351c8c188..cfe5b8be192 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -1196,8 +1196,8 @@ radv_link_shaders(const struct radv_device *device, struct radv_shader_stage *pr nir_validate_shader(producer, "after nir_lower_io_arrays_to_elements"); nir_validate_shader(consumer, "after nir_lower_io_arrays_to_elements"); - radv_nir_lower_io_to_scalar_early(producer, nir_var_shader_out); - radv_nir_lower_io_to_scalar_early(consumer, nir_var_shader_in); + radv_nir_lower_io_vars_to_scalar(producer, nir_var_shader_out); + radv_nir_lower_io_vars_to_scalar(consumer, nir_var_shader_in); /* Remove PSIZ from shaders when it's not needed. * This is typically produced by translation layers like Zink or D9VK. diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index f32238616d2..9a53669f50a 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -1018,7 +1018,7 @@ v3d_nir_lower_vs_early(struct v3d_compile *c) /* Split our I/O vars and dead code eliminate the unused * components. */ - NIR_PASS(_, c->s, nir_lower_io_to_scalar_early, + NIR_PASS(_, c->s, nir_lower_io_vars_to_scalar, nir_var_shader_in | nir_var_shader_out); uint64_t used_outputs[4] = {0}; for (int i = 0; i < c->vs_key->num_used_outputs; i++) { @@ -1060,7 +1060,7 @@ v3d_nir_lower_gs_early(struct v3d_compile *c) /* Split our I/O vars and dead code eliminate the unused * components. */ - NIR_PASS(_, c->s, nir_lower_io_to_scalar_early, + NIR_PASS(_, c->s, nir_lower_io_vars_to_scalar, nir_var_shader_in | nir_var_shader_out); uint64_t used_outputs[4] = {0}; for (int i = 0; i < c->gs_key->num_used_outputs; i++) { diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 8f2d65b0d99..070f9f28739 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -1744,8 +1744,8 @@ link_shaders(nir_shader *producer, nir_shader *consumer) assert(consumer); if (producer->options->lower_to_scalar) { - NIR_PASS(_, producer, nir_lower_io_to_scalar_early, nir_var_shader_out); - NIR_PASS(_, consumer, nir_lower_io_to_scalar_early, nir_var_shader_in); + NIR_PASS(_, producer, nir_lower_io_vars_to_scalar, nir_var_shader_out); + NIR_PASS(_, consumer, nir_lower_io_vars_to_scalar, nir_var_shader_in); } nir_lower_io_arrays_to_elements(producer, consumer); diff --git a/src/compiler/glsl/gl_nir_link_varyings.c b/src/compiler/glsl/gl_nir_link_varyings.c index 5adb2908820..6199c22f634 100644 --- a/src/compiler/glsl/gl_nir_link_varyings.c +++ b/src/compiler/glsl/gl_nir_link_varyings.c @@ -4008,8 +4008,8 @@ link_shader_opts(struct varying_matches *vm, */ if (producer->options->lower_to_scalar && !vm->disable_varying_packing && !vm->disable_xfb_packing) { - NIR_PASS(_, producer, nir_lower_io_to_scalar_early, nir_var_shader_out); - NIR_PASS(_, consumer, nir_lower_io_to_scalar_early, nir_var_shader_in); + NIR_PASS(_, producer, nir_lower_io_vars_to_scalar, nir_var_shader_out); + NIR_PASS(_, consumer, nir_lower_io_vars_to_scalar, nir_var_shader_in); } gl_nir_opts(producer); diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 3947faa2ea2..c7af9f801be 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5312,7 +5312,7 @@ 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); 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_to_scalar_early(nir_shader *shader, nir_variable_mode mask); +bool nir_lower_io_vars_to_scalar(nir_shader *shader, nir_variable_mode mask); bool nir_lower_io_to_vector(nir_shader *shader, nir_variable_mode mask); bool nir_vectorize_tess_levels(nir_shader *shader); nir_shader *nir_create_passthrough_tcs_impl(const nir_shader_compiler_options *options, diff --git a/src/compiler/nir/nir_lower_io_to_scalar.c b/src/compiler/nir/nir_lower_io_to_scalar.c index f00d2b83900..f1c8e0c13c2 100644 --- a/src/compiler/nir/nir_lower_io_to_scalar.c +++ b/src/compiler/nir/nir_lower_io_to_scalar.c @@ -493,7 +493,7 @@ struct io_to_scalar_early_state { }; static bool -nir_lower_io_to_scalar_early_instr(nir_builder *b, nir_instr *instr, void *data) +nir_lower_io_vars_to_scalar_instr(nir_builder *b, nir_instr *instr, void *data) { struct io_to_scalar_early_state *state = data; @@ -580,7 +580,7 @@ nir_lower_io_to_scalar_early_instr(nir_builder *b, nir_instr *instr, void *data) * i.e. before nir_lower_io() is called. */ bool -nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask) +nir_lower_io_vars_to_scalar(nir_shader *shader, nir_variable_mode mask) { struct io_to_scalar_early_state state = { .split_inputs = _mesa_pointer_hash_table_create(NULL), @@ -589,7 +589,7 @@ nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask) }; bool progress = nir_shader_instructions_pass(shader, - nir_lower_io_to_scalar_early_instr, + nir_lower_io_vars_to_scalar_instr, nir_metadata_control_flow, &state); diff --git a/src/freedreno/vulkan/tu_shader.cc b/src/freedreno/vulkan/tu_shader.cc index 1b811c33e22..d7d0a37e063 100644 --- a/src/freedreno/vulkan/tu_shader.cc +++ b/src/freedreno/vulkan/tu_shader.cc @@ -2786,7 +2786,7 @@ static void lower_io_to_scalar_early(nir_shader *nir, nir_variable_mode mask) { bool progress = false; - NIR_PASS(progress, nir, nir_lower_io_to_scalar_early, mask); + NIR_PASS(progress, nir, nir_lower_io_vars_to_scalar, mask); if (progress) { /* Optimize the new vector code and then remove dead vars. */ diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index ae514dfac22..1ae5c7e9298 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -1489,8 +1489,8 @@ brw_nir_link_shaders(const struct brw_compiler *compiler, nir_validate_shader(producer, "after nir_lower_io_arrays_to_elements"); nir_validate_shader(consumer, "after nir_lower_io_arrays_to_elements"); - NIR_PASS(_, producer, nir_lower_io_to_scalar_early, nir_var_shader_out); - NIR_PASS(_, consumer, nir_lower_io_to_scalar_early, nir_var_shader_in); + NIR_PASS(_, producer, nir_lower_io_vars_to_scalar, nir_var_shader_out); + NIR_PASS(_, consumer, nir_lower_io_vars_to_scalar, nir_var_shader_in); brw_nir_optimize(producer, devinfo); brw_nir_optimize(consumer, devinfo); diff --git a/src/intel/compiler/elk/elk_nir.c b/src/intel/compiler/elk/elk_nir.c index d8f1b8ca211..0e9bc79581d 100644 --- a/src/intel/compiler/elk/elk_nir.c +++ b/src/intel/compiler/elk/elk_nir.c @@ -1152,8 +1152,8 @@ elk_nir_link_shaders(const struct elk_compiler *compiler, const bool c_is_scalar = compiler->scalar_stage[consumer->info.stage]; if (p_is_scalar && c_is_scalar) { - NIR_PASS(_, producer, nir_lower_io_to_scalar_early, nir_var_shader_out); - NIR_PASS(_, consumer, nir_lower_io_to_scalar_early, nir_var_shader_in); + NIR_PASS(_, producer, nir_lower_io_vars_to_scalar, nir_var_shader_out); + NIR_PASS(_, consumer, nir_lower_io_vars_to_scalar, nir_var_shader_in); elk_nir_optimize(producer, p_is_scalar, devinfo); elk_nir_optimize(consumer, c_is_scalar, devinfo); }