shader-compiler-bugs icon indicating copy to clipboard operation
shader-compiler-bugs copied to clipboard

`vec` literals as statements cause compile errors

Open paulthomson opened this issue 9 years ago • 2 comments

[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.

paulthomson avatar Dec 02 '16 12:12 paulthomson

Reported: https://community.imgtec.com/forums/topic/bug-glsl-iphone-se-vec-literals-as-statements-give-shader-compile-error/

paulthomson avatar Dec 02 '16 12:12 paulthomson

Also reported to Apple. Bug report ID: 29479501

paulthomson avatar Dec 02 '16 12:12 paulthomson