shader-compiler-bugs
shader-compiler-bugs copied to clipboard
`vec` literals as statements cause compile errors
[Shaders, screenshots, error log, reproduction steps, etc.] [ZIP]
The following fragment shader fails to compile:
#version 100
#ifdef GL_ES
precision mediump float;
#endif
void main()
{
vec2(1.0, 1.0);
vec3(1.0, 1.0, 1.0);
vec4(1.0, 1.0, 1.0, 1.0);
}
Compile error:
Failed to compile fragment shader.
ERROR: 0:2: Expression of type 'vec2' - precision can not be inferred and no default precision available
ERROR: 0:3: Expression of type 'vec3' - precision can not be inferred and no default precision available
ERROR: 0:4: Expression of type 'vec4' - precision can not be inferred and no default precision available
The shader is valid according to glslangValidator.
Reported: https://community.imgtec.com/forums/topic/bug-glsl-iphone-se-vec-literals-as-statements-give-shader-compile-error/
Also reported to Apple. Bug report ID: 29479501