glsl/linker: Fail linking on ES if uniform precision qualifiers don't match
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 24 May 2016 19:04:53 +0000 (12:04 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 26 Aug 2016 22:03:15 +0000 (15:03 -0700)
When GL_OES_geometry_shader is enabled, this fixes
dEQP-GLES31.functional.shaders.linkage.geometry.uniform.rules.type_mismatch_1.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/linker.cpp

index 436b452f7d98cf56a9c43932568aeeef924c5125..c95edf3e63db751c12b220936fe06249445dbe4c 100644 (file)
@@ -1153,6 +1153,13 @@ cross_validate_globals(struct gl_shader_program *prog,
                          mode_string(var), var->name);
             return;
          }
+
+         if (prog->IsES && existing->data.precision != var->data.precision) {
+            linker_error(prog, "declarations for %s `%s` have "
+                         "mismatching precision qualifiers\n",
+                         mode_string(var), var->name);
+            return;
+         }
       } else
          variables->add_variable(var);
    }