aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2017-11-03 10:46:30 +0100
committerIago Toral Quiroga <[email protected]>2017-11-13 09:22:26 +0100
commit456e10944fca0c5af7abcccd0cd901dc7e833b21 (patch)
treee63701982cbe69b1c221361c8e9d7f3b25af8a83 /src/compiler/glsl/link_varyings.cpp
parentbec716e8441e3fcef71ce8f9d17d98ddf5a652e0 (diff)
glsl/linker: use without_array() to retrieve type
This is what we do in the condition too, so it makes sense. v2: Only compute without_array() once (Ilia). Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_varyings.cpp')
-rw-r--r--src/compiler/glsl/link_varyings.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index e6639306bed..72309365a03 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,