When I want to initialize uniform struct variable an unexpected error is generated.
link program fail!Vertex shader(s) failed to link, fragment shader(s) failed to link.
The shader codes:
bool enableAtten;//Enable or disable attenuation
uniform LightSource defaultLightSource=LightSource( vec4(0.1,0.1,0.1,1.0),//ambient
I tested these code on windows 7 with ATI mobility Radeon HD 3470. Is it a bug ?
Solved! Go to Solution.
Yes, whenever you see "Unexpected Error", that's effectively an internal compiler error and shouldn't happen, even for illegal shaders. You have hit a bug - thanks very much for finding it! I just reproduced it on our internal builds, so it's still there. I'll have our compiler guys take a look at it.
Can you post all the shader source you used for linking? I tried with you code piece, but It links successfully.
The complete shader files are attached (It is annoying to paste the codes into the reply which takes each row as separated part ). It is a simple implementation of Phong shading.