Fragment Shader Compile Error…

This topic contains 1 reply, has 2 voices, and was last updated by  Gordon 8 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29953

    honestee
    Member

    mediump float UnPackRGBAToFloat(const mediump vec4 v)
    {

        const mediump vec4 vTest = vec4(1.0);
        const mediump vec4 vBitShift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
        return (dot(v, vBitShift));
    }
    void main()
    {

        gl_FragColor = vec4(1.0);
    }

     

    which outputs ‘Compile failed’, but doesn’t explain why…

     

    If I comment out ‘const’ keyword(red only) like

     

    mediump float UnPackRGBAToFloat(const mediump vec4 v)
    {

        const mediump vec4 vTest = vec4(1.0);
        
    mediump vec4 vBitShift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);

        ……

     

    which outputs ‘Success’…

     

    I don’t know why…
    #33462

    Gordon
    Moderator

    This looks like it may be a compiler bug so I’ve put it into our system for further investigation (BRN28628).

    Obviously, the workaround is not to use const for this line. Thanks for the report.Gordon2009-10-23 10:44:15

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.