Vertex attribute output count... ...exceeds hardware limits

After we updated the driver to 169.07 (to update to CUDA 1.1), we got the following error message when we try to link a GLSL shader:

Can anyone explain this? Did you change any hardware limits for varying variables because we use a lot of them in the shader? (I’m running a 8800 GTX under Linux).

Hi Morph208,

If you can provide the shaders and/or a repro app, I will be happy to file a bug. Feel free to send me a private message.

Mark

Thanks Mark. We’re gonna work on a repro app as soon as we can.

I don’t think the hardware limits changed; probably with the old version of the driver, your program was almost on the limit. The new version probably does some more optimization, or some other additional stuff, that makes it run over these limits just now.

Hello Mark,

thank you for your answer. I am currently working with Morph208 on a similar GLSL shader to the one I am going to post here, but this is just minimized version to show our problem - the shader does not really do anything.

So please ignore that most calculations look useless. (I replaced all texture lookups with constants, removed uniform variables and tried to include as few operations as possible to produce the linking error)

Vertex shader:

// 9 varying vec3

// 2 varying vec4

// 1 varying float

// = 36 varying values

varying vec3 normal;

varying vec3 rawNormal;

varying vec3 rawVertexPosition;

varying vec3 lightPosition;

varying vec3 lightDirection;

varying vec3 halfVector;

varying vec3 vDirection;

varying float dist;

varying vec4 diffuse;

varying vec4 ambient;

varying vec3 lightVec;

varying vec3 eyeVec;

void main()

{

    rawNormal = gl_Normal.xyz;

    normal = gl_NormalMatrix * gl_Normal;

   rawVertexPosition = gl_Vertex.xyz;

    vec4 vertexPosition = gl_ModelViewMatrix * gl_Vertex;

   lightPosition = gl_LightSource[0].position.xyz;

    lightDirection = (lightPosition - vertexPosition.xyz);

   dist = length(lightDirection);

   lightDirection = normalize(lightDirection);

   vDirection = normalize(-vertexPosition.xyz);

   halfVector = normalize(gl_LightSource[0].spotDirection);

   diffuse = gl_LightSource[0].diffuse;

    ambient = gl_LightSource[0].ambient;

   gl_TexCoord[0] = vec4(1.0, gl_MultiTexCoord0.tpq);

    gl_TexCoord[1] = vec4(0.5, gl_MultiTexCoord0.tpq);

   //SET POSITION

    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

    

    lightVec = cross(halfVector, normal);

    eyeVec = cross(vDirection, normal);

    crossVec = cross(lightVec, eyeVec);

}

Fragment shader:

// 9 varying vec3

// 2 varying vec4

// 1 varying float

// = 36 varying variables

varying vec3 normal;

varying vec3 rawNormal;

varying vec3 rawVertexPosition;

varying vec3 lightPosition;

varying vec3 lightDirection;

varying vec3 halfVector;

varying vec3 vDirection;

varying float dist;

varying vec4 diffuse;

varying vec4 ambient;

varying vec3 lightVec;

varying vec3 eyeVec;

void main()

{

    //8 dot()

    //6 max()

    //3 smoothstep()

    //6 mix()

    //5 pow()

    

    float specular = max(dot(vec3(1.0), vDirection),0.0);

    float specular_t = max(dot(vec3(1.0), vDirection),0.0);

    float specular_t2 = max(dot(vec3(1.0), vec3(1.0)),0.0);

    float nDotHalfVector = max(dot(normal, halfVector),0.0);

    float disturbNDotHalfVector = max(dot(vec3(1.0), halfVector),0.0);

   float HVdotLightDir = max(dot(halfVector, lightDirection),0.0);

    

    float stuff_0 = smoothstep(0.0, 1.0, dot(rawNormal, vec3(1.0)));

   vec3 mix_color = mix(vec3(0.0), vec3(1.0), 1.0);

   

    float att = (pow(HVdotLightDir,1.0))/ (gl_LightSource[0].constantAttenuation +

            gl_LightSource[0].linearAttenuation * dist +

            gl_LightSource[0].quadraticAttenuation * dist * dist);

   vec4 final_color = ambient + att * diffuse;

   float step_ro = smoothstep(0.0, 1.0, dist);

    

    vec3 color_ro = vec3(pow(clamp(dot(reflect(-lightVec, normal), eyeVec), 0.0, 1.0), 1.0 ));

   final_color = mix(vec4(color_ro,1.0), final_color, step_ro);

   vec3 specular_color = vec3(1.0) * pow(nDotHalfVector,1.0);

   specular_color += vec3(1.0) * pow(specular_t,1.0);

    specular_color += vec3(1.0) * pow(specular_t2,1.0);

   vec4 texture_color = vec4(1.0);

    texture_color.bg += vec2(1.0);

   texture_color.rgb = mix(vec3(1.0), texture_color.rgb, vec3(1.0));

   texture_color.rgb = mix(vec3(1.0), texture_color.rgb, vec3(1.0));

   float artefact_threshold = smoothstep(0.0,1.0,gl_TexCoord[0].t);

    

    texture_color.rgb = mix(texture_color.rgb, vec3(1.0), artefact_threshold);

   texture_color.rgb = mix(texture_color.rgb, mix_color, stuff_0);

   gl_FragColor = vec4(( (final_color.rgb * texture_color.rgb + specular_color.rgb) ), 1.0);

}

If we load this shader with the driver version 100.14.11 the resulting fragment values will be white. If we use the latest driver 169.09 it should result in the described error.

We are running this on Geforce 8800 GTX graphics boards - are we exceeding any hardware limits or what kind of problem are we dealing with?

Thanks for your help!

Kind regards,

Chris

NVIDIA? Any feedback?

Chris found a thread on a OpenGL forum discussing the same issue:

http://www.opengl.org/discussion_boards/ub…3383#Post233383