glsl: remove duplicate interpolation_string() function
We already have one in the IR code that can be used everywhere its needed in the AST code so remove the one from the AST. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:
@@ -685,18 +685,6 @@ struct ast_type_qualifier {
|
||||
*/
|
||||
bool has_auxiliary_storage() const;
|
||||
|
||||
/**
|
||||
* \brief Return string representation of interpolation qualifier.
|
||||
*
|
||||
* If an interpolation qualifier is present, then return that qualifier's
|
||||
* string representation. Otherwise, return null. For example, if the
|
||||
* noperspective bit is set, then this returns "noperspective".
|
||||
*
|
||||
* If multiple interpolation qualifiers are somehow present, then the
|
||||
* returned string is undefined but not null.
|
||||
*/
|
||||
const char *interpolation_string() const;
|
||||
|
||||
bool merge_qualifier(YYLTYPE *loc,
|
||||
_mesa_glsl_parse_state *state,
|
||||
const ast_type_qualifier &q,
|
||||
|
@@ -4690,8 +4690,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
&& this->type->qualifier.has_interpolation()
|
||||
&& this->type->qualifier.flags.q.varying) {
|
||||
|
||||
const char *i = this->type->qualifier.interpolation_string();
|
||||
assert(i != NULL);
|
||||
const char *i = interpolation_string(var->data.interpolation);
|
||||
const char *s;
|
||||
if (this->type->qualifier.flags.q.centroid)
|
||||
s = "centroid varying";
|
||||
@@ -4721,9 +4720,7 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
if (state->is_version(130, 300)
|
||||
&& this->type->qualifier.has_interpolation()) {
|
||||
|
||||
const char *i = this->type->qualifier.interpolation_string();
|
||||
assert(i != NULL);
|
||||
|
||||
const char *i = interpolation_string(var->data.interpolation);
|
||||
switch (state->stage) {
|
||||
case MESA_SHADER_VERTEX:
|
||||
if (this->type->qualifier.flags.q.in) {
|
||||
|
@@ -102,19 +102,6 @@ ast_type_qualifier::has_auxiliary_storage() const
|
||||
|| this->flags.q.patch;
|
||||
}
|
||||
|
||||
const char*
|
||||
ast_type_qualifier::interpolation_string() const
|
||||
{
|
||||
if (this->flags.q.smooth)
|
||||
return "smooth";
|
||||
else if (this->flags.q.flat)
|
||||
return "flat";
|
||||
else if (this->flags.q.noperspective)
|
||||
return "noperspective";
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function merges both duplicate identifies within a single layout and
|
||||
* multiple layout qualifiers on a single variable declaration. The
|
||||
|
Reference in New Issue
Block a user