The function used a variable named 'score', which was an outright lie.
A signature matches or it doesn't; there is no fuzzy scoring.

CC: Ian Romanick <[email protected]>
CC: Kenneth Graunke <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
---
 src/glsl/ir_function.cpp |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/glsl/ir_function.cpp b/src/glsl/ir_function.cpp
index e25b094..5a2c9bb 100644
--- a/src/glsl/ir_function.cpp
+++ b/src/glsl/ir_function.cpp
@@ -134,18 +134,23 @@ ir_function::matching_signature(const exec_list 
*actual_parameters)
       ir_function_signature *const sig =
         (ir_function_signature *) iter.get();
 
-      const int score = parameter_lists_match(& sig->parameters,
-                                             actual_parameters);
-
-      /* If we found an exact match, simply return it */
-      if (score == 0)
+      switch (parameter_lists_match(& sig->parameters, actual_parameters)) {
+      case 0:
+        /* Exact match. */
         return sig;
-
-      if (score > 0) {
+      case 1:
+        /* Inexact match that requires implicit conversion. */
         if (match == NULL)
            match = sig;
         else
            multiple_inexact_matches = true;
+        continue;
+      case -1:
+        /* Not a match. */
+        continue;
+      default:
+        assert(false);
+        return NULL;
       }
    }
 
-- 
1.7.6

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to