[Mesa-dev] [PATCH 12/26] glsl: validate linking of intrastage component qualifiers

Timothy Arceri timothy.arceri at collabora.com
Mon Feb 29 01:17:52 UTC 2016


Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
 src/compiler/glsl/linker.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index abf568b..1818da5 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -988,6 +988,13 @@ cross_validate_globals(struct gl_shader_program *prog,
 		     return;
 	       }
 
+	       if (var->data.location_frac != existing->data.location_frac) {
+		     linker_error(prog, "explicit components for %s "
+				  "`%s' have differing values\n",
+				  mode_string(var), var->name);
+		     return;
+	       }
+
 	       existing->data.location = var->data.location;
 	       existing->data.explicit_location = true;
 	    } else {
-- 
2.5.0



More information about the mesa-dev mailing list