From Section 5.8, OpenGL® ES Shader Language (v1.00, r17) [PDF] (emphasis added):
The assignment operator stores the value of the rvalue expression into an l-value and returns the r-value with the type and precision of the lvalue expression. The lvalue expression and the rvalue expression must be of the same type. All required type conversions must be specified explicitly through the constructor.
So it seems like something like this will not be legal:
vec3 my_vec3 = vec3(1, 2, 3);
vec4 my_vec4 = my_vec3;
And to make this legal, the second line should be something like:
vec4 my_vec4 = vec4(my_vec3, 1);
I assumed that it glVertexAttribPointerhas similar requirements. That is, if you have assigned vec4that parameter sizeshould be 4.
Then I came across a sample
, aPosition - vec4, glVertexAttribPointer, , size of 3. , GLES20TriangleRenderer, , - ?