aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast_function.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-09-10 09:01:25 +0200
committermarha <marha@users.sourceforge.net>2013-09-10 09:01:25 +0200
commit889d7dd8e94a5538f388cc619115bf5c0b6fc0b7 (patch)
treebdda17693281525be9d48886acf2dc89ac4c66b4 /mesalib/src/glsl/ast_function.cpp
parent2414a1de3cc17f438219f8f2a58b530d33e99a5e (diff)
downloadvcxsrv-889d7dd8e94a5538f388cc619115bf5c0b6fc0b7.tar.gz
vcxsrv-889d7dd8e94a5538f388cc619115bf5c0b6fc0b7.tar.bz2
vcxsrv-889d7dd8e94a5538f388cc619115bf5c0b6fc0b7.zip
fontconfig libX11 libXmu libxcb mesa xserver git update 10 Sep 2013
xserver commit 47ff382d1fce25a8b097d45b79489e891f1f1228 libxcb commit f1405d9fe4a6ddcae24585ba254389a4c4f4c8c9 libX11 commit cb107760df33ffc8630677e66e2e50aa37950a5c libXmu commit 2539e539eafdac88177c8ee30b043c5d52f017e4 fontconfig commit a61e145304da86c8c35b137493bbd8fd5dd1e7f5 mesa commit 395b9410860371a64d6b5f2d50679f29eb41729e
Diffstat (limited to 'mesalib/src/glsl/ast_function.cpp')
-rw-r--r--mesalib/src/glsl/ast_function.cpp35
1 files changed, 7 insertions, 28 deletions
diff --git a/mesalib/src/glsl/ast_function.cpp b/mesalib/src/glsl/ast_function.cpp
index 7df2b6925..02aad4f8f 100644
--- a/mesalib/src/glsl/ast_function.cpp
+++ b/mesalib/src/glsl/ast_function.cpp
@@ -388,7 +388,8 @@ match_function_by_name(const char *name,
if (f != NULL) {
/* Look for a match in the local shader. If exact, we're done. */
bool is_exact = false;
- sig = local_sig = f->matching_signature(actual_parameters, &is_exact);
+ sig = local_sig = f->matching_signature(state, actual_parameters,
+ &is_exact);
if (is_exact)
goto done;
@@ -402,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(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) {
@@ -471,6 +447,9 @@ no_matching_function_error(const char *name,
foreach_list (node, &f->signatures) {
ir_function_signature *sig = (ir_function_signature *) node;
+ if (sig->is_builtin() && !sig->is_builtin_available(state))
+ continue;
+
str = prototype_string(sig->return_type, f->name, &sig->parameters);
_mesa_glsl_error(loc, state, "%s%s", prefix, str);
ralloc_free(str);