diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-04-28 11:49:12 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-04-28 15:34:52 -0700 |
commit | abd40b15210c17b2a3ba8fcffc868fda203efa01 (patch) | |
tree | d5f78a55ee20488e0102a7ce1a6d2ac94d5d9fc3 /ir.cpp | |
parent | 0e385196f65d0f8dc3238e7eedb6f2d6c0a79a5d (diff) |
Factor out qualifier checking code for later reuse.
Diffstat (limited to 'ir.cpp')
-rw-r--r-- | ir.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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) { |