Will the follwing GLSL code work?
#version 330
uniform int size;
uniform float[size];
void main() {
//do something
}
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityNo. The size of the array has to be a constant.
Specifically from the GLSL specification:
4.1.9 Arrays
...
When an array size is specified in a declaration, it must be an integral constant expression (see Section 4.3.3 “Constant Expressions” ) greater than zero.