From: Chad Versace <chad.vers...@intel.com>

When validating a global variable in the linking stage, verify that each of
the layout qualifiers below is identical among all instances of the
global variable:
    - origin_upper_left
    - pixel_center_integer
---
 src/glsl/linker.cpp |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 616ec78..5398272 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -385,6 +385,18 @@ cross_validate_globals(struct gl_shader_program *prog,
               existing->explicit_location = true;
            }
 
+           /* Verify that each of the layout qualifiers below is identical 
among
+            * all instances of the variable.
+            */
+           if ((var->origin_upper_left != existing->origin_upper_left)
+               || (var->pixel_center_integer != 
existing->pixel_center_integer))
+           {
+              linker_error_printf(prog, "layout qualifiers for %s '%s' "
+                                        "do not match\n",
+                                        mode_string(var), var->name);
+              return false;
+           }
+
            /* FINISHME: Handle non-constant initializers.
             */
            if (var->constant_value != NULL) {
-- 
1.7.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to