summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-05-23 13:07:14 +1000
committerTimothy Arceri <[email protected]>2016-05-24 11:30:51 +1000
commit2d9308012c5da0891b099b5082c17d28bc51bb09 (patch)
tree717597cfa51db78a2dee1cc5cf98036b7e24f7cb /src/compiler/glsl/link_varyings.cpp
parent33397bf7fdca0b08924078189f18fa34d030ac67 (diff)
glsl: fix explicit location validation for doubles
Previously we would fail to find a match for the second half of a dvec4 as 'i' would get incremented to 1 before we added the var to the array at component 0. Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_varyings.cpp')
-rw-r--r--src/compiler/glsl/link_varyings.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 1782a967ebf..dd5c9cc6089 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -392,7 +392,8 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
}
while (idx < slot_limit) {
- for (unsigned i = var->data.location_frac; i < last_comp; i++) {
+ unsigned i = var->data.location_frac;
+ while (i < last_comp) {
if (explicit_locations[idx][i] != NULL) {
linker_error(prog,
"%s shader has multiple outputs explicitly "
@@ -418,6 +419,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
}
explicit_locations[idx][i] = var;
+ i++;
/* We need to do some special handling for doubles as dvec3 and
* dvec4 consume two consecutive locations. We don't need to