glsl: don't try adding built-ins to explicit locations bitmask
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 15 Dec 2015 05:23:29 +0000 (16:23 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Wed, 6 Jan 2016 22:06:26 +0000 (09:06 +1100)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
src/glsl/link_varyings.cpp

index 1da0c9e5527e236d5c98688034b92b699a3aaa0b..8763cc5b07d776dc62d44f4822d8c9e157726061 100644 (file)
@@ -1518,7 +1518,9 @@ reserved_varying_slot(struct gl_shader *stage, ir_variable_mode io_mode)
    foreach_in_list(ir_instruction, node, stage->ir) {
       ir_variable *const var = node->as_variable();
 
-      if (var == NULL || var->data.mode != io_mode || !var->data.explicit_location)
+      if (var == NULL || var->data.mode != io_mode ||
+          !var->data.explicit_location ||
+          var->data.location < VARYING_SLOT_VAR0)
          continue;
 
       var_slot = var->data.location - VARYING_SLOT_VAR0;