This is what we do in the condition too, so it makes sense. v2: Only compute without_array() once (Ilia).
Reviewed-by: Ilia Mirkin <imir...@alum.mit.edu> --- src/compiler/glsl/link_varyings.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp index 66a20a2c9b..1a9894baab 100644 --- a/src/compiler/glsl/link_varyings.cpp +++ b/src/compiler/glsl/link_varyings.cpp @@ -566,9 +566,10 @@ validate_explicit_variable_location(struct gl_context *ctx, return false; } - if (type->without_array()->is_interface()) { - for (unsigned i = 0; i < type->without_array()->length; i++) { - glsl_struct_field *field = &type->fields.structure[i]; + const glsl_type *type_without_array = type->without_array(); + if (type_without_array->is_interface()) { + for (unsigned i = 0; i < type_without_array->length; i++) { + glsl_struct_field *field = &type_without_array->fields.structure[i]; unsigned field_location = field->location - (field->patch ? VARYING_SLOT_PATCH0 : VARYING_SLOT_VAR0); if (!check_location_aliasing(explicit_locations, var, -- 2.11.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev