Mesa (master): glsl: ignore interface precision qualifier on desktop GL

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 27 10:15:49 UTC 2021


Module: Mesa
Branch: master
Commit: d93153a56437f2ecc066f16cbf6f9d23e369fb98
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d93153a56437f2ecc066f16cbf6f9d23e369fb98

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Wed Apr 21 09:54:38 2021 +0300

glsl: ignore interface precision qualifier on desktop GL

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 <tapani.palli at intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10373>

---

 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.



More information about the mesa-commit mailing list