glsl: move get_varying_type() declaration earlier
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 21 Sep 2023 06:48:22 +0000 (16:48 +1000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 22 Sep 2023 00:41:18 +0000 (00:41 +0000)
Required for the following patch to keep this file somewhat organised.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25318>

src/compiler/glsl/gl_nir_link_varyings.c

index 354c741..a554f8c 100644 (file)
@@ -65,6 +65,23 @@ compare_attr(const void *a, const void *b)
 }
 
 /**
+ * Get the varying type stripped of the outermost array if we're processing
+ * a stage whose varyings are arrays indexed by a vertex number (such as
+ * geometry shader inputs).
+ */
+static const struct glsl_type *
+get_varying_type(const nir_variable *var, gl_shader_stage stage)
+{
+   const struct glsl_type *type = var->type;
+   if (nir_is_arrayed_io(var, stage) || var->data.per_view) {
+      assert(glsl_type_is_array(type));
+      type = glsl_get_array_element(type);
+   }
+
+   return type;
+}
+
+/**
  * Find a contiguous set of available bits in a bitmask.
  *
  * \param used_mask     Bits representing used (1) and unused (0) locations
@@ -563,23 +580,6 @@ assign_attribute_or_color_locations(void *mem_ctx,
    return true;
 }
 
-/**
- * Get the varying type stripped of the outermost array if we're processing
- * a stage whose varyings are arrays indexed by a vertex number (such as
- * geometry shader inputs).
- */
-static const struct glsl_type *
-get_varying_type(const nir_variable *var, gl_shader_stage stage)
-{
-   const struct glsl_type *type = var->type;
-   if (nir_is_arrayed_io(var, stage) || var->data.per_view) {
-      assert(glsl_type_is_array(type));
-      type = glsl_get_array_element(type);
-   }
-
-   return type;
-}
-
 static bool
 varying_has_user_specified_location(const nir_variable *var)
 {