summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Gomez <agomez@igalia.com>2019-01-07 16:11:44 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2019-01-11 19:19:09 +0000
commit37a8e85fa4accae9bba35d2a08f619ae2dc5ca8c (patch)
tree21f0a6b579feb7ee5f12b13de6f5ecdd338ee50f
parent78d28da2092206d745f5070aa8b7263ad30124ad (diff)
glsl/linker: specify proper direction in location aliasing error
The check for location aliasing was always asuming output variables but this validation is also called for input variables. Fixes: e2abb75b0e4 ("glsl/linker: validate explicit locations for SSO programs") Cc: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (cherry picked from commit 428164d87f8dc1d378236b4913538803653770c6)
-rw-r--r--src/compiler/glsl/link_varyings.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 52e493cb599..3969c0120b3 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -481,9 +481,10 @@ check_location_aliasing(struct explicit_location_info explicit_locations[][4],
/* Component aliasing is not alloed */
if (comp >= component && comp < last_comp) {
linker_error(prog,
- "%s shader has multiple outputs explicitly "
+ "%s shader has multiple %sputs explicitly "
"assigned to location %d and component %d\n",
_mesa_shader_stage_to_string(stage),
+ var->data.mode == ir_var_shader_in ? "in" : "out",
location, comp);
return false;
} else {
@@ -502,10 +503,12 @@ check_location_aliasing(struct explicit_location_info explicit_locations[][4],
if (info->interpolation != interpolation) {
linker_error(prog,
- "%s shader has multiple outputs at explicit "
+ "%s shader has multiple %sputs at explicit "
"location %u with different interpolation "
"settings\n",
- _mesa_shader_stage_to_string(stage), location);
+ _mesa_shader_stage_to_string(stage),
+ var->data.mode == ir_var_shader_in ?
+ "in" : "out", location);
return false;
}
@@ -513,9 +516,11 @@ check_location_aliasing(struct explicit_location_info explicit_locations[][4],
info->sample != sample ||
info->patch != patch) {
linker_error(prog,
- "%s shader has multiple outputs at explicit "
+ "%s shader has multiple %sputs at explicit "
"location %u with different aux storage\n",
- _mesa_shader_stage_to_string(stage), location);
+ _mesa_shader_stage_to_string(stage),
+ var->data.mode == ir_var_shader_in ?
+ "in" : "out", location);
return false;
}
}