Closed pablode closed 1 month ago
This gives an funny error message if you try this variation:
bool someValue = false;
bool someOtherValue = true;
someValue |= someOtherValue
results in ERROR: 0:10: 'assign' : cannot convert from ' temp bool' to ' temp bool'
. I need to check what the GLSL spec actually allows here, but it seems like should be allowed.
In Section 5.9 of the GLSL spec you can see that there is a section explaining that bitwise operations are not allowed on boolean values:
The bitwise operators and (&), exclusive-or (^), and inclusive-or (|). The operands must be of type signed or unsigned integers or integer vectors.
However, the error message provided by glslang is rather inscrutable and does not make it at all clear what the problem is.
Ah, that explains it. I guess I was spoilt by C/C++ 😅 Thank you, and yes, a better error message would be helpful.
The compilation of following snippet
fails with
contrary to what I would expect.
https://shader-playground.timjones.io/1a0c89e120d03eb2b9f813ae8ba26a62