glsl: move get_varying_type() declaration earlier

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>
This commit is contained in:
Timothy Arceri
2023-09-21 16:48:22 +10:00
committed by Marge Bot
parent 08735fd90d
commit 8bf5c39994

View File

@@ -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)
{