Strange shader compilation error

I’m using a somewhat complex shader that has a couple of overloaded functions, which should be legal as per the GLSL spec, however during shader compilation i have the following error:

ERROR: 0:200: error(#229) Overloaded functions must have the same return type: unsigned int
ERROR: 0:204: error(#229) Overloaded functions must have the same return type: uvec2
ERROR: 0:209: error(#229) Overloaded functions must have the same return type: uvec3
ERROR: 0:213: error(#229) Overloaded functions must have the same return type: uvec4

Has anybody encountered this problem before?

The problem arise only on my PC, a 2017 imac running windows 10 (dual boot) with a radeon pro 560 (driver updated).

The GLSL4.2 spec (p. 90) says:
Function names can be overloaded. The same function name can be used for multiple functions, as long as the parameter types differ. If a function name is declared twice with the same parameter types, then the return types and all qualifiers must also match, and it is the same function being declared.

Might this be a driver/compiler bug?

If the functions have different parameter types, it would have to be. Overloads have always been allowed to return different types (so a function can e.g. return a vector of the same size as the argument). If both the name and the parameter types match a previous definition, it’s a redefinition rather than an overload and the return type must also match.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.