}
}
+static bool
+function_exists(_mesa_glsl_parse_state *state,
+ struct glsl_symbol_table *symbols, const char *name)
+{
+ ir_function *f = symbols->get_function(name);
+ if (f != NULL) {
+ foreach_in_list(ir_function_signature, sig, &f->signatures) {
+ if (sig->is_builtin() && !sig->is_builtin_available(state))
+ continue;
+ return true;
+ }
+ }
+ return false;
+}
+
static void
print_function_prototypes(_mesa_glsl_parse_state *state, YYLTYPE *loc,
ir_function *f)
{
gl_shader *sh = _mesa_glsl_get_builtin_function_shader();
- if (state->symbols->get_function(name) == NULL
+ if (!function_exists(state, state->symbols, name)
&& (!state->uses_builtin_functions
- || sh->symbols->get_function(name) == NULL)) {
+ || !function_exists(state, sh->symbols, name))) {
_mesa_glsl_error(loc, state, "no function with name '%s'", name);
} else {
char *str = prototype_string(NULL, name, actual_parameters);