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:
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");
}