Closed vron closed 3 years ago
Thanks for reporting. That’s indeed a bug. I’ll patch both problems today! :heart:
The required change was a bit bigger than what was expected, but all in all, the problem is now fixed. I’ll release the patch in glsl-5.0.1
.
Hi,
According to https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Struct_constructors and my experience floating point literals should be floats by default and not double as glsl currently parse them as.
Run e.g.:
To note that the 7.7 is parsed into the AST as a double constant instead of a float. This creates problems when e.g. using the AST to transpile to other languages since a double constant will be printed instead of a float constant => type errors.
I believe that the fix is as simple as swapping the order of float / double parsing in glsl/src/parsers.rs such that the Float one is first:
(Also note that the glsl version og glsl-tree should probably be bumped to the 5 release?)