PDA

View Full Version : GLSL float/vec3/vec4 array max size = GL_MAX_VERTEX_UNIFORM_VECTORS?



tower120
12-24-2013, 06:13 AM
I run

glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &maxVertUniformsVect);
and get 1024.

Than in GLSL I do

uniform mediump vec4[1020] instance_mat
and that was ok. But with vec3/vec2/float it fails:

uniform mediump float[1030] instance_mat; // fails
//uniform mediump vec2[1030] instance_mat; // and this
//uniform mediump vec3[1030] instance_mat; // and this
With following error:

cannot locate suitable resource to bind variable "instance_mat". Possibly large array.

The question is: Does GL_MAX_VERTEX_UNIFORM_VECTORS return the number of all kind of arrays, no matter what size they are?
I mean, no matter does this float/vec2/vec3/vec4 - all counts as one VERTEX_UNIFORM_VECTOR?

Nowhere-01
12-24-2013, 02:58 PM
it depends on implementation. do you test with AMD hardware by any chance?
http://www.opengl.org/wiki/Uniform_%28GLSL%29 , here "Implementation limits" mentions it.

tower120
12-25-2013, 10:05 AM
No, its nv9600m.