Mesa (master): glsl/linker: fix bug when checking precision qualifier

Samuel Iglesias Gonsálvez samuelig at kemper.freedesktop.org
Wed Feb 28 07:26:00 UTC 2018


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

Author: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Date:   Mon Jan 29 13:46:28 2018 +0100

glsl/linker: fix bug when checking precision qualifier

According to GLSL ES 3.2 spec, see table in 9.2.1 "Linked Shaders"
section, the precision qualifier should match for uniform variables.
This also applies to previous GLSL ES 3.x specs.

This 'if' checks the condition for uniform variables, while for UBOs
it is checked in link_interface_blocks.cpp.

Fixes: b50b82b8a553
("glsl/es31: precision qualifier doesn't need to match in shader interface block members")

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/compiler/glsl/linker.cpp | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index d3d18c248f..1444b68cb0 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -1111,15 +1111,10 @@ cross_validate_globals(struct gl_shader_program *prog,
             return;
          }
 
-         /* Only in GLSL ES 3.10, the precision qualifier should not match
-          * between block members defined in matched block names within a
-          * shader interface.
-          *
-          * In GLSL ES 3.00 and ES 3.20, precision qualifier for each block
-          * member should match.
+         /* Check the precision qualifier matches for uniform variables on
+          * GLSL ES.
           */
-         if (prog->IsES && (prog->data->Version != 310 ||
-                            !var->get_interface_type()) &&
+         if (prog->IsES && !var->get_interface_type() &&
              existing->data.precision != var->data.precision) {
             if ((existing->data.used && var->data.used) || prog->data->Version >= 300) {
                linker_error(prog, "declarations for %s `%s` have "




More information about the mesa-commit mailing list