glsl array prob

This topic contains 2 replies, has 2 voices, and was last updated by  dgu 3 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31689

    dgu
    Member

    Hello ,

    why
    highp vec2 steps[1] = {
    vec2( 0.1, 0.1)
    };
    is not possible in gles2 ??

    Kind regards
    david

    #38680

    Joe Davis
    Member

    Hi David,

    Section 4.1.9. of the GLSL ES 1.00 specification states that this is illegal

    There is no mechanism for initializing arrays at declaration time from within a shader.

    GLSL ES 3.00 has a mechanism for array initialization at declaration time, but the syntax is different (section 4.1.9. of the GLSL ES 3.00 spec)

    float x[] = float[2] (1.0, 2.0); // declares an array of size 2
    float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3
    float a[5];
    float b[] = a;

    Joe

    #38681

    dgu
    Member

    thanks JOE the day GLSL ES 1.00 will be archive is coming 🙂

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