diff options
author | marha <marha@users.sourceforge.net> | 2011-07-01 14:21:21 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-01 14:21:21 +0200 |
commit | d9f970a847e1af706f07560ef163b229bb592307 (patch) | |
tree | 2fe2204f673487f3a8d7150f14cc456c6eb48d62 /mesalib/src/glsl/ir_function.cpp | |
parent | 0feab87a4300a3e204e259d14a0a63e58e4a3c8f (diff) | |
download | vcxsrv-d9f970a847e1af706f07560ef163b229bb592307.tar.gz vcxsrv-d9f970a847e1af706f07560ef163b229bb592307.tar.bz2 vcxsrv-d9f970a847e1af706f07560ef163b229bb592307.zip |
xwininfo libX11 mesa mkfontscale xserver xkeyboard-config git update 1 Juli
2011
Diffstat (limited to 'mesalib/src/glsl/ir_function.cpp')
-rw-r--r-- | mesalib/src/glsl/ir_function.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mesalib/src/glsl/ir_function.cpp b/mesalib/src/glsl/ir_function.cpp index caee9296a..ef8d4fcfc 100644 --- a/mesalib/src/glsl/ir_function.cpp +++ b/mesalib/src/glsl/ir_function.cpp @@ -165,6 +165,7 @@ ir_function_signature * ir_function::matching_signature(const exec_list *actual_parameters) { ir_function_signature *match = NULL; + int matched_score; foreach_iter(exec_list_iterator, iter, signatures) { ir_function_signature *const sig = @@ -173,14 +174,14 @@ ir_function::matching_signature(const exec_list *actual_parameters) const int score = parameter_lists_match(& sig->parameters, actual_parameters); + /* If we found an exact match, simply return it */ if (score == 0) return sig; - if (score > 0) { - if (match != NULL) - return NULL; - + /* If we found a match with fewer conversions, use that instead */ + if (score > 0 && (match == NULL || score < matched_score)) { match = sig; + matched_score = score; } } |