gallivm/nir: fix vulkan vertex inputs

the tgsi file max is used to determine the number of input slots,
the old code was pretty bogus for the lavapipe cases (it worked
by accident).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7416>
diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
index 20052ba..eab7908 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
@@ -577,10 +577,18 @@
       info->num_inputs = util_bitcount64(nir->info.inputs_read);
       if (nir->info.inputs_read_indirectly)
          info->indirect_files |= 1 << TGSI_FILE_INPUT;
+      info->file_max[TGSI_FILE_INPUT] = info->num_inputs - 1;
+   } else {
+      int max = -1;
+      nir_foreach_shader_in_variable(var, nir) {
+	 int slots = glsl_count_attribute_slots(var->type, false);
+	 int tmax = var->data.driver_location + slots - 1;
+	 if (tmax > max)
+	    max = tmax;
+	 info->file_max[TGSI_FILE_INPUT] = max;
+      }
    }
 
-   info->file_max[TGSI_FILE_INPUT] = info->num_inputs - 1;
-
    i = 0;
    uint64_t processed_outputs = 0;
    unsigned num_outputs = 0;