View Full Version : character literals

05-03-2016, 02:53 PM
I can do the following in my fragment shader with a nvidia 4.50 context:

int myChar = 65;
if (myChar == 'A')

Are string literals a nvidia feature or is it standard GLSL?
I can't find anything about it in the specification.
What's the minimum GLSL version to use character literals?

05-03-2016, 04:42 PM
GLSL spec (https://www.opengl.org/registry/doc/GLSLangSpec.4.50.pdf), section 3.1, says:
There are no character or string data types, so no quoting characters are included.
And 3.3:
Character constants are not supported.
This is almost certainly a quirk of NVIDIA's compiler.