[Mesa-dev] mis-counting varying vars in the linker
Brian Paul
brianp at vmware.com
Wed Oct 26 11:11:15 PDT 2011
I think the linker is mis-counting gl_TexCoord[] varying vars when
linking.
For example, if we have this vertex/fragment shader combination:
// vs
void main()
{
gl_Position = ftransform();
gl_TexCoord[6] = gl_MultiTexCoord[0];
}
// fs
void main()
{
gl_Color = gl_TexCoord[6];
}
the varying_vectors counter in assign_varying_locations() will be 7,
not 1. It seems the gl_TexCoord var is being seen as an array of 7
elements and we're counting the whole array rather than the individual
elements used.
This is causing a link failure in an app here because the vs/fs shader
pair uses several user-defined varying vars plus gl_TexCoord[4]. The
varying count exceeds GL_MAX_VARYING_FLOATS even though we're really
not using that many varying slots.
-Brian
More information about the mesa-dev
mailing list