From 3713e2d5800e09079124b3689887cc9f1f6585fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 25 Jun 2025 18:59:37 -0400 Subject: [PATCH] nir: rename nir_lower_clip_cull_distance_arrays -> nir_lower_clip_cull_distance_array_vars Acked-by: Alyssa Rosenzweig Part-of: --- src/amd/vulkan/radv_shader.c | 2 +- src/compiler/glsl/gl_nir_linker.c | 2 +- src/compiler/nir/meson.build | 2 +- src/compiler/nir/nir.h | 2 +- ...e_arrays.c => nir_lower_clip_cull_distance_array_vars.c} | 4 ++-- src/compiler/nir/nir_shader_compiler_options.h | 2 +- src/microsoft/compiler/dxil_nir.c | 6 +++--- src/microsoft/spirv_to_dxil/dxil_spirv_nir.c | 2 +- src/vulkan/runtime/vk_nir.c | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) rename src/compiler/nir/{nir_lower_clip_cull_distance_arrays.c => nir_lower_clip_cull_distance_array_vars.c} (99%) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index a050a3b7c68..dd1988d28ea 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -487,7 +487,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_PASS(_, nir, nir_lower_clip_cull_distance_arrays); + NIR_PASS(_, nir, nir_lower_clip_cull_distance_array_vars); if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL || nir->info.stage == MESA_SHADER_GEOMETRY) diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index 4f9f3a7822d..ef688052d06 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -1436,7 +1436,7 @@ prelink_lowering(const struct gl_constants *consts, */ if (!(nir->options->io_options & nir_io_separate_clip_cull_distance_arrays)) - NIR_PASS(_, nir, nir_lower_clip_cull_distance_arrays); + NIR_PASS(_, nir, nir_lower_clip_cull_distance_array_vars); } return true; diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index d6a9e89ac70..51dfa8d8f88 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -153,7 +153,7 @@ else 'nir_lower_cl_images.c', 'nir_lower_clamp_color_outputs.c', 'nir_lower_clip.c', - 'nir_lower_clip_cull_distance_arrays.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', diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index d953e35e9c9..67806e120ad 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5778,7 +5778,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_arrays(nir_shader *nir); +bool nir_lower_clip_cull_distance_array_vars(nir_shader *nir); bool nir_lower_clip_disable(nir_shader *shader, unsigned clip_plane_enable); bool nir_lower_point_size_mov(nir_shader *shader, diff --git a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c b/src/compiler/nir/nir_lower_clip_cull_distance_array_vars.c similarity index 99% rename from src/compiler/nir/nir_lower_clip_cull_distance_arrays.c rename to src/compiler/nir/nir_lower_clip_cull_distance_array_vars.c index e292509054c..70db280dc07 100644 --- a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c +++ b/src/compiler/nir/nir_lower_clip_cull_distance_array_vars.c @@ -28,7 +28,7 @@ /** * This file contains two different lowering passes. * - * 1. nir_lower_clip_cull_distance_arrays() + * 1. nir_lower_clip_cull_distance_array_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 @@ -495,7 +495,7 @@ combine_clip_cull(nir_shader *nir, } bool -nir_lower_clip_cull_distance_arrays(nir_shader *nir) +nir_lower_clip_cull_distance_array_vars(nir_shader *nir) { bool progress = false; diff --git a/src/compiler/nir/nir_shader_compiler_options.h b/src/compiler/nir/nir_shader_compiler_options.h index 426ec62805b..122012ead7a 100644 --- a/src/compiler/nir/nir_shader_compiler_options.h +++ b/src/compiler/nir/nir_shader_compiler_options.h @@ -207,7 +207,7 @@ typedef enum { * Whether clip and cull distance arrays should be separate. If this is not * set, cull distances will be moved into VARYING_SLOT_CLIP_DISTn after clip * distances, and shader_info::clip_distance_array_size will be the index - * of the first cull distance. nir_lower_clip_cull_distance_arrays does + * of the first cull distance. nir_lower_clip_cull_distance_array_vars does * that. */ nir_io_separate_clip_cull_distance_arrays = BITFIELD_BIT(18), diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c index 69fa0945f2e..40c129bdf8e 100644 --- a/src/microsoft/compiler/dxil_nir.c +++ b/src/microsoft/compiler/dxil_nir.c @@ -930,9 +930,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_arrays. + * what's produced by nir_lower_clip_cull_distance_array_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_arrays, then + * This is what's produced by the sequence of nir_lower_clip_cull_distance_array_vars, then * I/O lowering, vectorization, optimization, and I/O un-lowering. */ static bool @@ -957,7 +957,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_arrays() + * and cull should've been merged by nir_lower_clip_cull_distance_array_vars() */ assert(var->data.location == VARYING_SLOT_CLIP_DIST0 || var->data.location == VARYING_SLOT_CLIP_DIST1); diff --git a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c index 4acfeac8706..5dc09528ad7 100644 --- a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c +++ b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c @@ -1020,7 +1020,7 @@ dxil_spirv_nir_passes(nir_shader *nir, NIR_PASS_V(nir, dxil_nir_lower_int_cubemaps, false); - NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays); + NIR_PASS_V(nir, nir_lower_clip_cull_distance_array_vars); NIR_PASS_V(nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, true); NIR_PASS_V(nir, nir_lower_global_vars_to_local); NIR_PASS_V(nir, nir_split_var_copies); diff --git a/src/vulkan/runtime/vk_nir.c b/src/vulkan/runtime/vk_nir.c index f120a2a6463..93b34a6ceea 100644 --- a/src/vulkan/runtime/vk_nir.c +++ b/src/vulkan/runtime/vk_nir.c @@ -196,7 +196,7 @@ vk_spirv_to_nir(struct vk_device *device, * insert dead clip/cull vars and we don't want to clip/cull based on * uninitialized garbage. */ - NIR_PASS(_, nir, nir_lower_clip_cull_distance_arrays); + NIR_PASS(_, nir, nir_lower_clip_cull_distance_array_vars); if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL ||