From a83fc4183f7f8b2ac9913f7adcce435a147d6556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Thu, 1 Sep 2016 12:01:11 +0300 Subject: [PATCH] glsl/linker: print only warning if uniform was not used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loosen the check for cross-stage validation of uniform precision qualifiers, emit only warning if existing uniform was not used (not read or written to). Signed-off-by: Tapani Pälli Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97532 --- src/compiler/glsl/linker.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index c95edf3..df36966 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -1155,10 +1155,16 @@ cross_validate_globals(struct gl_shader_program *prog, } 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); + if (existing->data.used) { + linker_error(prog, "declarations for %s `%s` have " + "mismatching precision qualifiers\n", + mode_string(var), var->name); return; + } else { + linker_warning(prog, "declarations for %s `%s` have " + "mismatching precision qualifiers\n", + mode_string(var), var->name); + } } } else variables->add_variable(var); -- 2.7.4