I am using instanced rendering by passing an array of model view matrices. What is the maximum array size possible for a particular uniform?
A uniform is a global Shader variable declared with the "uniform" storage qualifier. These act as parameters that the user of a shader program can pass to that program. Their values are stored in a program object.
Uniform variables can appear in any shader within a shader program, and are always used as input variables. They can be declared in one or more shaders within a program, but if a variable with a given name is declared in more than one shader, its type must be the same in all shaders.
This value will vary by hardware and implementation. I believe that
int maxUniformVectors;
glGet(GL_MAX_VERTEX_UNIFORM_VECTORS, &maxUniformVectors);
should answer your question. From the docs: this should return "the maximum number of four-element floating-point, integer, or boolean vectors that can be held in uniform variable storage for a vertex shader. The value must be at least 128."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With