PDA

View Full Version : Max length of uniform/attribute name



tarantula
07-17-2006, 06:36 AM
I couldn't find any maximum length for a variable name specifically uniforms and attributes. Can the names be arbitrarily large? Or do implementations fix it to some value?

Relic
07-17-2006, 07:29 AM
You shouldn't need to bother.
There are functions which return the maximum length of attribute and uniform names per program.
Use glGetProgramiv with GL_ACTIVE_UNIFORM_MAX_LENGTH or GL_ACTIVE_ATTRIBUTE_MAX.
Actual lengths can be queried with glGetActiveUniform and glGetActiveAttrib.

tarantula
07-17-2006, 02:39 PM
As a user of the OpenGL Api, I don't have to bother. But I was just wondering what the IHVs do/ could do.