glsl: validate linking of intrastage component qualifiers
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 27 Nov 2015 02:43:20 +0000 (13:43 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Sun, 1 May 2016 13:13:22 +0000 (23:13 +1000)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
src/compiler/glsl/linker.cpp

index 975b299db55e82ed3bd6c01e32165099487aa10a..f7b884e0173eb671a37e85b6ee1bfc1804a4da78 100644 (file)
@@ -988,6 +988,13 @@ cross_validate_globals(struct gl_shader_program *prog,
                     return;
               }
 
+              if (var->data.location_frac != existing->data.location_frac) {
+                    linker_error(prog, "explicit components for %s "
+                                 "`%s' have differing values\n",
+                                 mode_string(var), var->name);
+                    return;
+              }
+
               existing->data.location = var->data.location;
               existing->data.explicit_location = true;
            } else {