Is there a restriction regarding the number of varying variables? I currently use 4 x vec3, 2 x vec2 and 2 x vec4. That works fine, but when I use another I get this error:
That is even if its a single float. The target hardware is FX5950. I’ve tested with drivers 61.06 (Linux), 61.71 (win), 61.76 (win) and 62.20 (win). I can post the code if it helps.
In general, (for non-GeForce 6xxx hardware) 8 vector varyings is all you get. Smarter compilers will eventually be able to concatonate smaller varyings into larger ones. For example, the compiler has the ability to take your 2 vec2’s and use a single vec4 varying on it. However, glslang compilers are just trying to be compliant these days; eventually they’ll get around to more aggressive optimizations.
In the meantime, you can always do it yourself. Just use a vec4 instead of 2 vec2’s.
you can get the number of varying floats avalaible with the right glGet* (GL_MAX_VARYING_FLOATS_ARB, and GL_MAX_TEXTURE_COORDS_ARB) (you can have more varyings than texture interpolators, for example, you can have 8 texture interpolators, but 64 varying floats)