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

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to