_mesa_glsl_error(loc, state,
"interpolation qualifier `%s' can only be applied to "
"shader inputs or outputs.",
- var->interpolation_string());
+ interpolation_string(var->interpolation));
}
_mesa_glsl_error(loc, state,
"interpolation qualifier `%s' cannot be applied to "
"vertex shader inputs or fragment shader outputs",
- var->interpolation_string());
+ interpolation_string(var->interpolation));
}
}
const char *
-ir_variable::interpolation_string() const
+interpolation_string(unsigned interpolation)
{
- switch (this->interpolation) {
+ switch (interpolation) {
case INTERP_QUALIFIER_NONE: return "no";
case INTERP_QUALIFIER_SMOOTH: return "smooth";
case INTERP_QUALIFIER_FLAT: return "flat";
int swizzle;
};
+
+/**
+ * Get the string value for an interpolation qualifier
+ *
+ * \return The string that would be used in a shader to specify \c
+ * mode will be returned.
+ *
+ * This function is used to generate error messages of the form "shader
+ * uses %s interpolation qualifier", so in the case where there is no
+ * interpolation qualifier, it returns "no".
+ *
+ * This function should only be used on a shader input or output variable.
+ */
+const char *interpolation_string(unsigned interpolation);
+
+
class ir_variable : public ir_instruction {
public:
ir_variable(const struct glsl_type *, const char *, ir_variable_mode);
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
- /**
- * Get the string value for the interpolation qualifier
- *
- * \return The string that would be used in a shader to specify \c
- * mode will be returned.
- *
- * This function is used to generate error messages of the form "shader
- * uses %s interpolation qualifier", so in the case where there is no
- * interpolation qualifier, it returns "no".
- *
- * This function should only be used on a shader input or output variable.
- */
- const char *interpolation_string() const;
-
/**
* Determine how this variable should be interpolated based on its
* interpolation qualifier (if present), whether it is gl_Color or
"interpolation qualifier\n",
_mesa_glsl_shader_target_name(producer_type),
output->name,
- output->interpolation_string(),
+ interpolation_string(output->interpolation),
_mesa_glsl_shader_target_name(consumer_type),
- input->interpolation_string());
+ interpolation_string(input->interpolation));
return;
}
}