Phone complains that identical GLSL struct definition differs in vert/frag programs
- by stephelton
When I provide the following struct definition in linked frag and vert shaders, my phone (Samsung Vibrant / Android 2.2) complains that the definition differs.
struct Light {
mediump vec3 _position;
lowp vec4 _ambient;
lowp vec4 _diffuse;
lowp vec4 _specular;
bool _isDirectional;
mediump vec3 _attenuation; // constant, linear, and quadratic components
};
uniform Light u_light;
I know the struct is identical because its included from another file. These shaders work on a linux implementation and on my Android 3.0 tablet. Both shaders declare "precision mediump float;"
The exact error is:
Uniform variable u_light type/precision does not match in vertex and fragment shader
Am I doing anything wrong here, or is my phone's implementation broken? Any advice (other than file a bug report?)