nir/lower_clip_cull: Store array size for FS inputs

I think the rationale for not setting the size for inputs is that
when passed between geometry stages the clip and cull distances are
supposed to be treated like any other varying. However, this isn't 100%
the case for the FS, since when it's read by the FS it's also used by
the fixed-function stage. In freedreno we setup varying locations when
compiling the FS, and then tack on VS-only outputs like gl_Position at
the end. Furthermore there's code to compact input locations based on
what's actually read. But this compaction can't happen for clip and cull
distances, because then we won't have space for components that are only
read by the clipper. So, we need to know the original number of
components for both arrays. Modify this pass so that we don't have to go
digging around for it ourselves.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6959>
diff --git a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c b/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c
index b9dc851..5b2672e 100644
--- a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c
+++ b/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c
@@ -127,8 +127,10 @@
    if (nir->info.stage <= MESA_SHADER_GEOMETRY)
       progress |= combine_clip_cull(nir, nir_var_shader_out, true);
 
-   if (nir->info.stage > MESA_SHADER_VERTEX)
-      progress |= combine_clip_cull(nir, nir_var_shader_in, false);
+   if (nir->info.stage > MESA_SHADER_VERTEX) {
+      progress |= combine_clip_cull(nir, nir_var_shader_in,
+                                    nir->info.stage == MESA_SHADER_FRAGMENT);
+   }
 
    nir_foreach_function(function, nir) {
       if (!function->impl)