[Mesa-dev] [PATCH 19/21] glsl: Switch to the new built-in function module.

Kenneth Graunke kenneth at whitecape.org
Wed Sep 4 15:22:42 PDT 2013


All built-ins are now handled by the new code; the old system is dead.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/glsl/ast_function.cpp       | 29 ++---------------------------
 src/glsl/glsl_parser_extras.cpp |  2 +-
 src/glsl/main.cpp               |  2 +-
 3 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index e0fdfc3..02aad4f 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -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) {
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 8669b77..cd3907a 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -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();
 }
 
 }
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index e13d5c4..57bec44 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -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;
 }
-- 
1.8.3.4



More information about the mesa-dev mailing list