The following trivial method creates a compile time error: #version 330 core ... float nothing() { return 0; } ... 2016-03-11 11:44:31.223 yaogl[4191:4191] [YAShader] Configuration: cs:0 vs:37 tcs:0 tes:0 gs:0 fs:38 2016-03-11 11:44:31.226 yaogl[4191:4191] [YAShader] Shader 37 compiled. 2016-03-11 11:44:31.236 yaogl[4191:4191] [YAShader] GLSL compiler error: 0:89(2): error: `return' with wrong type int, in function `nothing' returning float 2016-03-11 11:44:31.236 yaogl[4191:4191] [YAShader] Shader 38 compiled with errors.
Implicit conversions on return values was added in GLSL 4.20 and GL_ARB_shading_language_420pack. Section 1.2.6 (Summary of Changes from Version 4.10) of the GLSL 4.20 spec says, "Allow implicit conversions of return values to the declared type of the function." The overview section of the GL_ARB_shading_language_420pack spec says the same thing. Does this work if you add #extension GL_ARB_shading_language_420pack: require to the shader?
GL_ARB_shading_language_420pack resolved the problem.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.