MESA_shader_integer_functions: Allow new function overload matching rules
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 21 Jun 2016 17:29:49 +0000 (10:29 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 19 Jul 2016 19:19:28 +0000 (12:19 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/glsl/ir_function.cpp

index 0b4cb4bd30d398a13627839eff88060f99693316..c0b62af11a9db775f150abec3aca7ddb84cce2c4 100644 (file)
@@ -268,11 +268,13 @@ choose_best_inexact_overload(_mesa_glsl_parse_state *state,
    if (num_matches == 1)
       return *matches;
 
    if (num_matches == 1)
       return *matches;
 
-   /* Without GLSL 4.0 / ARB_gpu_shader5, there is no overload resolution
-    * among multiple inexact matches. Note that state may be NULL here if
-    * called from the linker; in that case we assume everything supported in
-    * any GLSL version is available. */
-   if (!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable) {
+   /* Without GLSL 4.0, ARB_gpu_shader5, or MESA_shader_integer_functions,
+    * there is no overload resolution among multiple inexact matches. Note
+    * that state may be NULL here if called from the linker; in that case we
+    * assume everything supported in any GLSL version is available.
+    */
+   if (!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable ||
+       state->MESA_shader_integer_functions_enable) {
       for (ir_function_signature **sig = matches; sig < matches + num_matches; sig++) {
          if (is_best_inexact_overload(actual_parameters, matches, num_matches, *sig))
             return *sig;
       for (ir_function_signature **sig = matches; sig < matches + num_matches; sig++) {
          if (is_best_inexact_overload(actual_parameters, matches, num_matches, *sig))
             return *sig;