Factor out qualifier checking code for later reuse.

This commit is contained in:
Kenneth Graunke
2010-04-28 11:49:12 -07:00
committed by Ian Romanick
parent 0e385196f6
commit abd40b1521
3 changed files with 39 additions and 20 deletions

26
ir.cpp
View File

@@ -338,6 +338,32 @@ ir_function_signature::ir_function_signature(const glsl_type *return_type)
}
const char *
ir_function_signature::qualifiers_match(exec_list *params)
{
exec_list_iterator iter_a = parameters.iterator();
exec_list_iterator iter_b = params->iterator();
/* check that the qualifiers match. */
while (iter_a.has_next()) {
ir_variable *a = (ir_variable *)iter_a.get();
ir_variable *b = (ir_variable *)iter_b.get();
if (a->read_only != b->read_only ||
a->interpolation != b->interpolation ||
a->centroid != b->centroid) {
/* parameter a's qualifiers don't match */
return a->name;
}
iter_a.next();
iter_b.next();
}
return NULL;
}
ir_function::ir_function(const char *name)
: name(name)
{