Simple question about glsl standard (or about generic compiler included in ShaderDesigner):
Why is it illegal to use expressions with built-in functions to initialize a constant? For example this shader:
In GLSLangSpec.Full.1.10.59.pdf sqrt function defined asCode :const float f = sqrt( 0.5 ); // ERROR: 0: 1: '=' : assigning non-constant to 'const float' void main() { gl_FragColor = vec4( f ); }
so if x have type 'const float' so return type should also be 'const float', isn't it?Code :genType sqrt (genType x)
Yes, I can remove 'const' and it will compile, but I'm just curious - is this error correct according to standard?
PS. Nvidia compiler works fine with this code.



