aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/linker.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-07-19 08:30:15 +0200
committermarha <marha@users.sourceforge.net>2013-07-19 08:30:15 +0200
commit89bc3ee988b62eb5e10284bac32a176955546410 (patch)
tree186769abb7a48a7b04463706dee116795e07485f /mesalib/src/glsl/linker.cpp
parentf5e157731e6b51421ac89cfefb666b8bbf971b03 (diff)
downloadvcxsrv-89bc3ee988b62eb5e10284bac32a176955546410.tar.gz
vcxsrv-89bc3ee988b62eb5e10284bac32a176955546410.tar.bz2
vcxsrv-89bc3ee988b62eb5e10284bac32a176955546410.zip
mesa xkbcomp git update 19 Jul 2013
xkbcomp commit 0ebdf47fd4bc434ac3d2339544c022a869510738 esa commit 9f07ca11c1797ac12de1e1c6aef13cf58824b5f5
Diffstat (limited to 'mesalib/src/glsl/linker.cpp')
-rw-r--r--mesalib/src/glsl/linker.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index ba97ade25..ac010cfbb 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -541,6 +541,25 @@ cross_validate_globals(struct gl_shader_program *prog,
existing->explicit_location = true;
}
+ /* From the GLSL 4.20 specification:
+ * "A link error will result if two compilation units in a program
+ * specify different integer-constant bindings for the same
+ * opaque-uniform name. However, it is not an error to specify a
+ * binding on some but not all declarations for the same name"
+ */
+ if (var->explicit_binding) {
+ if (existing->explicit_binding &&
+ var->binding != existing->binding) {
+ linker_error(prog, "explicit bindings for %s "
+ "`%s' have differing values\n",
+ mode_string(var), var->name);
+ return false;
+ }
+
+ existing->binding = var->binding;
+ existing->explicit_binding = true;
+ }
+
/* Validate layout qualifiers for gl_FragDepth.
*
* From the AMD/ARB_conservative_depth specs:
@@ -1147,7 +1166,7 @@ update_array_sizes(struct gl_shader_program *prog)
}
}
- if (size + 1 != var->type->fields.array->length) {
+ if (size + 1 != var->type->length) {
/* If this is a built-in uniform (i.e., it's backed by some
* fixed-function state), adjust the number of state slots to
* match the new array size. The number of slots per array entry