From 89bc3ee988b62eb5e10284bac32a176955546410 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 19 Jul 2013 08:30:15 +0200 Subject: mesa xkbcomp git update 19 Jul 2013 xkbcomp commit 0ebdf47fd4bc434ac3d2339544c022a869510738 esa commit 9f07ca11c1797ac12de1e1c6aef13cf58824b5f5 --- mesalib/src/glsl/linker.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'mesalib/src/glsl/linker.cpp') 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 -- cgit v1.2.3