From d93153a56437f2ecc066f16cbf6f9d23e369fb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 21 Apr 2021 09:54:38 +0300 Subject: [PATCH] glsl: ignore interface precision qualifier on desktop GL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes linking failures with new GL45 linkage tests, no regressions spotted on existing tests. v2: add spec reference (Samuel) Signed-off-by: Tapani Pälli Reviewed-by: Samuel Iglesias Gonsálvez Part-of: --- src/compiler/glsl/link_interface_blocks.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/compiler/glsl/link_interface_blocks.cpp b/src/compiler/glsl/link_interface_blocks.cpp index 4471b41cf0e..d954a89e903 100644 --- a/src/compiler/glsl/link_interface_blocks.cpp +++ b/src/compiler/glsl/link_interface_blocks.cpp @@ -109,8 +109,19 @@ intrastage_match(ir_variable *a, struct gl_shader_program *prog, bool match_precision) { + /* From section 4.7 "Precision and Precision Qualifiers" in GLSL 4.50: + * + * "For the purposes of determining if an output from one shader + * stage matches an input of the next stage, the precision qualifier + * need not match." + */ + bool interface_type_match = + (prog->IsES ? + a->get_interface_type() == b->get_interface_type() : + a->get_interface_type()->compare_no_precision(b->get_interface_type())); + /* Types must match. */ - if (a->get_interface_type() != b->get_interface_type()) { + if (!interface_type_match) { /* Exception: if both the interface blocks are implicitly declared, * don't force their types to match. They might mismatch due to the two * shaders using different GLSL versions, and that's ok.