glsl: Skip unavailable built-ins when matching signatures.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 31 Aug 2013 06:15:59 +0000 (23:15 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 9 Sep 2013 18:52:21 +0000 (11:52 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/ir_function.cpp

index 2dd98bcc291a895e5b9392aceef47f7348ad2e75..53cf469d9c075195d1a442304bd65bbde328f5bc 100644 (file)
@@ -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;
    }