nir: give nir_lower_clip_cull_distance_array_vars a better name

also rename the file

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38465>
This commit is contained in:
Marek Olšák 2025-11-14 19:49:42 -05:00 committed by Marge Bot
parent 74995eb64d
commit 0c400fbed9
8 changed files with 12 additions and 12 deletions

View file

@ -604,7 +604,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st
NIR_PASS(_, nir, nir_propagate_invariant, pdev->cache_key.invariant_geom);
nir_gather_clip_cull_distance_sizes_from_vars(nir);
NIR_PASS(_, nir, nir_lower_clip_cull_distance_array_vars);
NIR_PASS(_, nir, nir_merge_clip_cull_distance_vars);
if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL ||
nir->info.stage == MESA_SHADER_GEOMETRY)

View file

@ -1437,7 +1437,7 @@ prelink_lowering(const struct pipe_screen *screen,
}
/* Combine clip and cull outputs into one array. */
NIR_PASS(_, nir, nir_lower_clip_cull_distance_array_vars);
NIR_PASS(_, nir, nir_merge_clip_cull_distance_vars);
}
return true;

View file

@ -104,6 +104,7 @@ else
'nir_builtin_builder.c',
'nir_builtin_builder.h',
'nir_conversion_builder.h',
'nir_clip_cull_distance_io_utils.c',
'nir_clone.c',
'nir_constant_expressions.h',
'nir_control_flow.c',
@ -153,7 +154,6 @@ else
'nir_lower_cl_images.c',
'nir_lower_clamp_color_outputs.c',
'nir_lower_clip.c',
'nir_lower_clip_cull_distance_array_vars.c',
'nir_lower_clip_disable.c',
'nir_lower_clip_halfz.c',
'nir_lower_const_arrays_to_uniforms.c',

View file

@ -6062,7 +6062,7 @@ bool nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables,
bool use_clipdist_array, bool use_load_interp);
bool nir_lower_clip_cull_distance_to_vec4s(nir_shader *shader);
bool nir_lower_clip_cull_distance_array_vars(nir_shader *nir);
bool nir_merge_clip_cull_distance_vars(nir_shader *nir);
bool nir_lower_clip_disable(nir_shader *shader, unsigned clip_plane_enable);
bool nir_lower_frexp(nir_shader *nir);

View file

@ -28,7 +28,7 @@
/**
* This file contains multiple functions.
*
* 1. nir_lower_clip_cull_distance_array_vars()
* 1. nir_merge_clip_cull_distance_vars()
*
* This pass combines clip and cull distance arrays in separate locations
* and colocates them both in VARYING_SLOT_CLIP_DIST0. It does so by
@ -470,7 +470,7 @@ combine_clip_cull(nir_shader *nir, nir_variable_mode mode)
}
bool
nir_lower_clip_cull_distance_array_vars(nir_shader *nir)
nir_merge_clip_cull_distance_vars(nir_shader *nir)
{
bool progress = false;
@ -518,7 +518,7 @@ nir_gather_clip_cull_distance_sizes_from_vars(nir_shader *nir)
assert(!clip || clip->data.compact);
assert(!cull || cull->data.compact);
/* nir_lower_clip_cull_distance_array_vars must not have been called. */
/* nir_merge_clip_cull_distance_vars must not have been called. */
assert(!clip || clip->data.how_declared != nir_var_hidden);
nir->info.clip_distance_array_size = get_unwrapped_array_length(nir, clip);

View file

@ -798,9 +798,9 @@ struct dxil_nir_split_clip_cull_distance_params {
*
* This pass can deal with splitting across two axes:
* 1. Given { float clip[5]; float cull[3]; }, split clip into clip[4] and clip1[1]. This is
* what's produced by nir_lower_clip_cull_distance_array_vars.
* what's produced by nir_merge_clip_cull_distance_vars.
* 2. Given { float clip[4]; float clipcull[4]; }, split clipcull into clip1[1] and cull[3].
* This is what's produced by the sequence of nir_lower_clip_cull_distance_array_vars, then
* This is what's produced by the sequence of nir_merge_clip_cull_distance_vars, then
* I/O lowering, vectorization, optimization, and I/O un-lowering.
*/
static bool
@ -825,7 +825,7 @@ dxil_nir_split_clip_cull_distance_instr(nir_builder *b,
nir_variable *new_var = params->new_var[new_var_idx];
/* The location should only be inside clip distance, because clip
* and cull should've been merged by nir_lower_clip_cull_distance_array_vars()
* and cull should've been merged by nir_merge_clip_cull_distance_vars()
*/
assert(var->data.location == VARYING_SLOT_CLIP_DIST0 ||
var->data.location == VARYING_SLOT_CLIP_DIST1);

View file

@ -1029,7 +1029,7 @@ dxil_spirv_nir_passes(nir_shader *nir,
NIR_PASS(_, nir, dxil_nir_lower_int_cubemaps, false);
nir_gather_clip_cull_distance_sizes_from_vars(nir);
NIR_PASS(_, nir, nir_lower_clip_cull_distance_array_vars);
NIR_PASS(_, nir, nir_merge_clip_cull_distance_vars);
NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries, nir_shader_get_entrypoint(nir),
nir_var_shader_out | nir_var_shader_in);
NIR_PASS(_, nir, nir_lower_global_vars_to_local);

View file

@ -196,7 +196,7 @@ vk_spirv_to_nir(struct vk_device *device,
* uninitialized garbage.
*/
nir_gather_clip_cull_distance_sizes_from_vars(nir);
NIR_PASS(_, nir, nir_lower_clip_cull_distance_array_vars);
NIR_PASS(_, nir, nir_merge_clip_cull_distance_vars);
if (nir->info.stage == MESA_SHADER_VERTEX ||
nir->info.stage == MESA_SHADER_TESS_EVAL ||