[Bug] [GLSL] [iPhone SE] vec literals as statements give shader compile error

This topic contains 0 replies, has 1 voice, and was last updated by  Paul 10 months, 3 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #55032

    Paul
    Member

    The fragment shader file, reproduction steps and platform info are available here:
    https://github.com/mc-imperial/shader-compiler-bugs/issues/38

    The bug can be triggered from Safari via WebGL (see above link).

    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.

Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.