I know that I can glGet
with GL_MAX_VARYING_VECTORS
to get the number of 4-component vectors I can use as varyings. What about other size vectors, matrices, and arrays of said types? How closely can these be packed; what are the restrictions?
I came across this question with a good answer. However, I am interested in desktop OpenGL, not OpenGL ES. Is there a difference in this case? I briefly searched this spec but found nothing useful.
Besides a general interest in how varyings are packed, I have a shader program whose sole varying is an array of vec2
s. I want to programmatically get the largest size that this array can be. How can I derive that from GL_MAX_VARYING_VECTORS
?
On my computer, GL_MAX_VARYING_VECTORS
is 16
, and I can size the array up to 62
before it won't compile.
Additionally, should I even be using varying
s? I'm aware that newer versions of GLSL use an in
/out
syntax; should I switch, and do you know of any resources to get me started?