In my experiment, it works well. Has specification described this situation, or it depends on the driver?

mbentrup

07-07-2011, 09:17 AM

If you haven't enabled VertexAttribArray(1), the driver will pass the "current" value for this attribiute, i.e. usually the last value set with glVertexAttrib4f(1, x,y,z,w) or similar functions.

AFAIR the current value is undefined after some functions, but this shouldn't be a problem if you don't use the attrib. In fact many GLSL compilers will detect that this attribute is not used and remove the attribute, so that glGetAttribLocation for this attribute returns -1.

Alfonse Reinheart

07-07-2011, 10:12 AM

AFAIR the current value is undefined after some functions, but this shouldn't be a problem if you don't use the attrib.

Because rendering in the core spec is not defined in terms of changing global state, the default generic attributes are always well-defined, according to the core spec.