From: Timothy Arceri Date: Thu, 21 Sep 2023 06:48:22 +0000 (+1000) Subject: glsl: move get_varying_type() declaration earlier X-Git-Tag: upstream/23.3.3~1756 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bf5c3999485c17531b0c396ab11e76e3d846be2;p=platform%2Fupstream%2Fmesa.git glsl: move get_varying_type() declaration earlier Required for the following patch to keep this file somewhat organised. Reviewed-by: Emma Anholt Part-of: --- diff --git a/src/compiler/glsl/gl_nir_link_varyings.c b/src/compiler/glsl/gl_nir_link_varyings.c index 354c741..a554f8c 100644 --- a/src/compiler/glsl/gl_nir_link_varyings.c +++ b/src/compiler/glsl/gl_nir_link_varyings.c @@ -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) {