From: Kenneth Graunke Date: Sat, 31 Aug 2013 06:15:59 +0000 (-0700) Subject: glsl: Skip unavailable built-ins when matching signatures. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ffcef04cee5eaa14617fa1dfb92fdb4a68332cf;p=mesa.git glsl: Skip unavailable built-ins when matching signatures. Signed-off-by: Kenneth Graunke Reviewed-by: Matt Turner Reviewed-by: Paul Berry --- diff --git a/src/glsl/ir_function.cpp b/src/glsl/ir_function.cpp index 2dd98bcc291..53cf469d9c0 100644 --- a/src/glsl/ir_function.cpp +++ b/src/glsl/ir_function.cpp @@ -145,6 +145,10 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state, ir_function_signature *const sig = (ir_function_signature *) iter.get(); + /* Skip over any built-ins that aren't available in this shader. */ + if (sig->is_builtin() && !sig->is_builtin_available(state)) + continue; + switch (parameter_lists_match(& sig->parameters, actual_parameters)) { case PARAMETER_LIST_EXACT_MATCH: *is_exact = true; @@ -212,6 +216,10 @@ ir_function::exact_matching_signature(_mesa_glsl_parse_state *state, ir_function_signature *const sig = (ir_function_signature *) iter.get(); + /* Skip over any built-ins that aren't available in this shader. */ + if (sig->is_builtin() && !sig->is_builtin_available(state)) + continue; + if (parameter_lists_match_exact(&sig->parameters, actual_parameters)) return sig; }