glsl: Switch to the new built-in function module.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 2 Sep 2013 03:48:45 +0000 (20:48 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 9 Sep 2013 21:42:33 +0000 (14:42 -0700)
All built-ins are now handled by the new code; the old system is dead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/ast_function.cpp
src/glsl/glsl_parser_extras.cpp
src/glsl/main.cpp

index e0fdfc3fe32e70f1603715f76519f85e3ea1006a..02aad4f8f85810587c5db062d4cc876b315792b3 100644 (file)
@@ -403,33 +403,8 @@ match_function_by_name(const char *name,
    }
 
    /* Local shader has no exact candidates; check the built-ins. */
-   _mesa_glsl_initialize_functions(state);
-   for (unsigned i = 0; i < state->num_builtins_to_link; i++) {
-      ir_function *builtin =
-        state->builtins_to_link[i]->symbols->get_function(name);
-      if (builtin == NULL)
-        continue;
-
-      bool is_exact = false;
-      ir_function_signature *builtin_sig =
-        builtin->matching_signature(state, actual_parameters, &is_exact);
-
-      if (builtin_sig == NULL)
-        continue;
-
-      /* If the built-in signature is exact, we can stop. */
-      if (is_exact) {
-        sig = builtin_sig;
-        goto done;
-      }
-
-      if (sig == NULL) {
-        /* We found an inexact match, which is better than nothing.  However,
-         * we should keep searching for an exact match.
-         */
-        sig = builtin_sig;
-      }
-   }
+   _mesa_glsl_initialize_builtin_functions();
+   sig = _mesa_glsl_find_builtin_function(state, name, actual_parameters);
 
 done:
    if (sig != NULL) {
index 8669b77629b6dfc3e66a73b78414899dd8e2f527..cd3907ae2bb30f7d18eaf3eaf9fa39a0bca591c2 100644 (file)
@@ -1625,7 +1625,7 @@ _mesa_destroy_shader_compiler(void)
 void
 _mesa_destroy_shader_compiler_caches(void)
 {
-   _mesa_glsl_release_functions();
+   _mesa_glsl_release_builtin_functions();
 }
 
 }
index e13d5c452964c06c3fd5def674a5544b202956b6..57bec44be5af282b331d03ce5bdbe75f4bba5980 100644 (file)
@@ -230,7 +230,7 @@ main(int argc, char **argv)
 
    ralloc_free(whole_program);
    _mesa_glsl_release_types();
-   _mesa_glsl_release_functions();
+   _mesa_glsl_release_builtin_functions();
 
    return status;
 }