glsl: At link-time, check that globals have matching centroid qualifiers
authorChad Versace <chad.versace@intel.com>
Mon, 10 Jan 2011 23:29:30 +0000 (15:29 -0800)
committerChad Versace <chad.versace@intel.com>
Mon, 10 Jan 2011 23:29:30 +0000 (15:29 -0800)
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923

src/glsl/linker.cpp

index d8c42ac462427397648a7707a16721222658aade..c906d7442127dadb9c2f073134ea01a09aeab042 100644 (file)
@@ -422,6 +422,12 @@ cross_validate_globals(struct gl_shader_program *prog,
                                   mode_string(var), var->name);
               return false;
            }
+            if (existing->centroid != var->centroid) {
+               linker_error_printf(prog, "declarations for %s `%s' have "
+                                   "mismatching centroid qualifiers\n",
+                                   mode_string(var), var->name);
+               return false;
+            }
         } else
            variables.add_variable(var);
       }