diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 62b82ba0a27..0d7a4188c4e 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -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) diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index acc9c03c9a0..73a540ea616 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -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; diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index 49c28177fe7..e13cd1df407 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -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', diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index b4c29c49b99..5f25c46ca91 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -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); diff --git a/src/compiler/nir/nir_lower_clip_cull_distance_array_vars.c b/src/compiler/nir/nir_clip_cull_distance_io_utils.c similarity index 98% rename from src/compiler/nir/nir_lower_clip_cull_distance_array_vars.c rename to src/compiler/nir/nir_clip_cull_distance_io_utils.c index 5cd417d6e92..08b9fdb1014 100644 --- a/src/compiler/nir/nir_lower_clip_cull_distance_array_vars.c +++ b/src/compiler/nir/nir_clip_cull_distance_io_utils.c @@ -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); diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c index 54f707c6e82..c81aa090bea 100644 --- a/src/microsoft/compiler/dxil_nir.c +++ b/src/microsoft/compiler/dxil_nir.c @@ -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); diff --git a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c index 6f01ae0f246..62fde97c559 100644 --- a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c +++ b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c @@ -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); diff --git a/src/vulkan/runtime/vk_nir.c b/src/vulkan/runtime/vk_nir.c index 1f514d649dc..b9cec0878e9 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, * 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 ||