summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2016-01-14 14:10:59 +0200
committerTapani Pälli <tapani.palli@intel.com>2016-01-15 07:12:42 +0200
commitcf96bce0ca8b2d6b5d4641efea1f2feedc024957 (patch)
tree09c0a3cac3d5d9cf9b655491ace8fc8bcbf0efff
parent0556b87de4302195402ade43f400e859d9bfad0e (diff)
downloadexternal_mesa3d-cf96bce0ca8b2d6b5d4641efea1f2feedc024957.zip
external_mesa3d-cf96bce0ca8b2d6b5d4641efea1f2feedc024957.tar.gz
external_mesa3d-cf96bce0ca8b2d6b5d4641efea1f2feedc024957.tar.bz2
glsl: mark explicit uniforms as explicit in other stages too
If shader declares uniform explicit location in one stage but implicit in another, explicit location should be used. Patch marks implicit uniforms as explicit if they were explicit in previous stage. This makes sure that we don't treat them implicit later when assigning locations. Fixes following CTS test: ES31-CTS.explicit_uniform_location.uniform-loc-implicit-in-some-stages3 v2: move check to cross_validate_globals (Timothy) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
-rw-r--r--src/glsl/linker.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 564c471..3f40c0b 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -992,7 +992,17 @@ cross_validate_globals(struct gl_shader_program *prog,
existing->data.location = var->data.location;
existing->data.explicit_location = true;
- }
+ } else {
+ /* Check if uniform with implicit location was marked explicit
+ * by earlier shader stage. If so, mark it explicit in this stage
+ * too to make sure later processing does not treat it as
+ * implicit one.
+ */
+ if (existing->data.explicit_location) {
+ var->data.location = existing->data.location;
+ var->data.explicit_location = true;
+ }
+ }
/* From the GLSL 4.20 specification:
* "A link error will result if two compilation units in a program