1

I'm trying to port a shader from glsl 300 es to glsl 100, so it works on more devices. I have an array, it works completly fine on glsl 300 es, but on glsl 100 it just does not work. To test if it's an issue with the rest of my shader, or an issue with the array I added a simple array to the most minimal shader.

#version 100
attribute vec2 Pos;

void main()
{
    float[2] test;
    gl_Position = vec4(Pos,0,0);
}

When this shader is compiled webgl gives me this error:

ERROR: 0:6: 'first-class array' : not supported

1 Answer 1

2

The correct syntax is

float[2] test;

float test[2];

See also Data Type (GLSL) - Array

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.