From 259fc505454ea6a67aeacf6cdebf1398d9947759 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 24 May 2016 12:04:53 -0700 Subject: [PATCH] glsl/linker: Fail linking on ES if uniform precision qualifiers don't match 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 Reviewed-by: Ilia Mirkin Reviewed-by: Kenneth Graunke --- src/compiler/glsl/linker.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 436b452f7d9..c95edf3e63d 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -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); } -- 2.30.2