Skip to content

glsl: report no function instead of empty candidate list

Erik Faye-Lund requested to merge kusma/mesa:glsl-no-function into master

When generating the error message for a missing function error where all available overloads were missing due to a too low GLSL version, we used to report something like this:

0:224(14): error: no matching function for call to
           `textureCubeLod(samplerCube, vec3, float)'; candidates are:
0:224(14): error: type mismatch

This is a pretty confusing error message, and can throw people off when debugging. So let's instead check if any overload is available before we decide what to print. This allow us to report something like this instead:

0:224(14): error: no function with name 'textureCubeLod'
0:224(14): error: type mismatch

This is arguably easier to understand for programmers, and doesn't send you on a wild goose chase to figure out what argument is wrong just because you stopped reading the message prematurely. I'm of course referring to a friend, not me. For sure. I would never do that.

Signed-off-by: Erik Faye-Lund erik.faye-lund@collabora.com

Edited by Erik Faye-Lund

Merge request reports