Hi,
   I have a set of vertex and fragment shader for phong shading. The code works properly on a system with GPU hardware (with nvidia OGL driver) but when I try to compile it under Mesa I am getting the following error

shader/slang/slang_builtin.c:433: _slang_alloc_statevar: Assertion `pos >= 0' failed

Can anybody help me with this error? The vertex and pixel shaders are given below

[vertex shader]
varying vec3 normal;
varying vec3 lightDir;
varying vec3 halfVector;
void main()
{
    normal = normalize(gl_NormalMatrix * gl_Normal);
    lightDir = normalize(gl_LightSource[0].position.xyz);
    halfVector = normalize(gl_LightSource[0].halfVector.xyz);
    gl_Position = ftransform();
}


[pixel shader]
varying vec3 normal;
varying vec3 lightDir;
varying vec3 halfVector;
void main()
{
       vec4 final_color = (gl_FrontLightModelProduct.sceneColor * gl_FrontMaterial.ambient) +
                          (gl_LightSource[0].ambient * gl_FrontMaterial.ambient);
       vec3 N = normalize(normal);
       vec3 L = normalize(lightDir);
       float x = dot(N, L);
       if(x > 0.0)
       {
           final_color += gl_LightSource[0].diffuse * gl_FrontMaterial.diffuse * x;
           vec3 E = normalize(halfVector);
           float specular = pow( max (dot(N, E), 0.0), gl_FrontMaterial.shininess);
           final_color += gl_LightSource[0].specular * gl_FrontMaterial.specular * specular;
       }
       gl_FragColor = final_color;
}


Thanks
Shibdas