Bugzilla – Bug 25771
Implicit converting "int" to "float" should be allowed in GLSL
Last modified: 2010-01-05 00:52:32 UTC
piglit/tests/glslparsertest/shaders/dataType5.frag expects it to fail:
float f = 1; // int cannot be converted to float, use constructor to do the conversion explicitly
But section 4.1.10 "Implicit Conversions" of GLSL spec (v1.20 or 1.50) says this is allowed.
This conversion is allowed, but only if the shader specifies '#version 120" or later. If no #version is specified, the default version 110 is used. In GLSL version 1.10 these automatic conversions are not allowed.
These GLSL tests were written by the authors of original the GLSL spec. We should assume that any test failures are problems in our drivers, not in the tests.
Thanks for the explanation. I was checking spec v1.20 and the latest v1.50, but didn't look into v1.10.
>> If no #version is specified, the default version 110 is used.
This default version is defined by mesa, right? Isn't mesa already supporting OpenGL 2.1 hence GLSL 1.2?
The default is defined by the GLSL spec. If no #version statement exists in the shader source, it is treated as if shader contained '#version 110'. For example, see this language from page 10 of the GLSL 1.50 spec:
"Version 1.10 of the language does not require shaders to include this directive, and shaders that do not include a #version directive will be treated as targeting version 1.10."
Agree this is not test case bug, but a driver bug.
I'm filing mesa bug#25877 to follow it up.