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;