From 8bf5c3999485c17531b0c396ab11e76e3d846be2 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 21 Sep 2023 16:48:22 +1000 Subject: [PATCH] glsl: move get_varying_type() declaration earlier Required for the following patch to keep this file somewhat organised. Reviewed-by: Emma Anholt Part-of: --- src/compiler/glsl/gl_nir_link_varyings.c | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/compiler/glsl/gl_nir_link_varyings.c b/src/compiler/glsl/gl_nir_link_varyings.c index 354c741b2e1..a554f8cf122 100644 --- a/src/compiler/glsl/gl_nir_link_varyings.c +++ b/src/compiler/glsl/gl_nir_link_varyings.c @@ -64,6 +64,23 @@ compare_attr(const void *a, const void *b) return r->slots - l->slots; } +/** + * 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. * @@ -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) {