summaryrefslogtreecommitdiff
path: root/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-07 16:44:30 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-07 16:49:25 -0700
commit5bfe30a02be67f2b0e757921295a89adfd368e3f (patch)
tree2e9c788231c87d03579884b2ca76541dfa9db4e4 /glsl_parser_extras.cpp
parent1b3f47fd363d74b1378f26ca0082a75db518aa1f (diff)
Add utility function to get the name of a shader target
Diffstat (limited to 'glsl_parser_extras.cpp')
-rw-r--r--glsl_parser_extras.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp
index 877b165ad7..335a058b96 100644
--- a/glsl_parser_extras.cpp
+++ b/glsl_parser_extras.cpp
@@ -37,6 +37,19 @@
#include "ir_constant_folding.h"
#include "ir_print_visitor.h"
+const char *
+_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target)
+{
+ switch (target) {
+ case vertex_shader: return "vertex";
+ case fragment_shader: return "fragment";
+ case geometry_shader: return "geometry";
+ }
+
+ assert(!"Should not get here.");
+}
+
+
void
_mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
const char *fmt, ...)