aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-04-07 16:41:40 -0700
committerIan Romanick <[email protected]>2010-04-07 16:49:25 -0700
commitae4c4c07959f059e557ea44e98552ced1fec9f47 (patch)
tree6ccc1eea4dddf9c3b35ddcf1fd827e2098d6d394
parent5bfe30a02be67f2b0e757921295a89adfd368e3f (diff)
Use _mesa_glsl_shader_target_name
-rw-r--r--ast_to_hir.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 6afd7eafec1..07d40e27d24 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -1306,11 +1306,12 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
if (qual->centroid)
var->centroid = 1;
- if (qual->attribute && state->target == fragment_shader) {
+ if (qual->attribute && state->target != vertex_shader) {
var->type = glsl_type::error_type;
_mesa_glsl_error(loc, state,
"`attribute' variables may not be declared in the "
- "fragment shader");
+ "%s shader",
+ _mesa_glsl_shader_target_name(state->target));
}
/* From page 25 (page 31 of the PDF) of the GLSL 1.10 spec:
@@ -1590,8 +1591,7 @@ ast_declarator_list::hir(exec_list *instructions,
if ((var->mode == ir_var_in) && (state->current_function == NULL)) {
_mesa_glsl_error(& initializer_loc, state,
"cannot initialize %s shader input / %s",
- (state->target == vertex_shader)
- ? "vertex" : "fragment",
+ _mesa_glsl_shader_target_name(state->target),
(state->target == vertex_shader)
? "attribute" : "varying");
}