summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-06-12 16:57:11 -0700
committerEric Anholt <[email protected]>2013-06-21 10:04:29 -0700
commitfaf3dbad0d30ed36ae6010a90ca2513edb591148 (patch)
tree77dfcda58e211cb78801cfaee2d3e9e837993979 /src/glsl/link_varyings.cpp
parent426ca34b7a2c3b9edfc0189daece8de3aff80627 (diff)
mesa: Use shared code for converting shader targets to short strings.
We were duplicating this code all over the place, and they all would need updating for the next set of shader targets. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 34e3440d67d..4fdbdc19942 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -31,6 +31,7 @@
#include "main/mtypes.h"
#include "glsl_symbol_table.h"
+#include "glsl_parser_extras.h"
#include "ir_optimization.h"
#include "linker.h"
#include "link_varyings.h"
@@ -47,9 +48,10 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
gl_shader *producer, gl_shader *consumer)
{
glsl_symbol_table parameters;
- /* FINISHME: Figure these out dynamically. */
- const char *const producer_stage = "vertex";
- const char *const consumer_stage = "fragment";
+ const char *const producer_stage =
+ _mesa_glsl_shader_target_name(producer->Type);
+ const char *const consumer_stage =
+ _mesa_glsl_shader_target_name(consumer->Type);
/* Find all shader outputs in the "producer" stage.
*/
@@ -1135,8 +1137,11 @@ assign_varying_locations(struct gl_context *ctx,
* "glsl1-varying read but not written" in piglit.
*/
- linker_error(prog, "fragment shader varying %s not written "
- "by vertex shader\n.", var->name);
+ linker_error(prog, "%s shader varying %s not written "
+ "by %s shader\n.",
+ _mesa_glsl_shader_target_name(consumer->Type),
+ var->name,
+ _mesa_glsl_shader_target_name(producer->Type));
}
/* An 'in' variable is only really a shader input if its