I'm having a weird "Internal Error" from linking a GLSL program, strange that glGetShaderInfoLog isn't producing junk.
I'm using a shader generator (I know Uber shaders are discouraged, but i'm using a semi-deferred renderer (depth pass first, then texture & lighting)) Everything works fine (~20fps@720p) with multiple lights, until I insert the per pixel fog, then it all comes crashing down with a compile error.
I've attached a sample fragment/vertex shader pair with the problem (sorry it seems obfuscated, it's been passed through https://github.com/aras-p/glsl-optimizer (which means there's nothing wrong with the code syntactically) - and it compiles with the PVR offline compiler without error).
One question at the back of my mind is "Is there a hard instruction limit?".
P.s. Is there a way around the junk output from glGetShaderInfoLog, it works fine on other platforms.
Oh, and the actual output is...
--From Fragment Shader:
--From Vertex Shader:
Internal error
Solved...
gl_FragCoord.z / gl_FragCoord.w
Was the culprit. Calculated depth differently and has fog.
Hi...
We took a look at the shaders with a different tool and got the following message:
Error: Symbol uEyePosition defined with different precision in vertex and fragment shaders.
Program object validation failed.
What seems to be happening is, the VS sets that uniform to high precision, while the FS forces medium precision. That’s not ok with uniforms. Note also that uEyePosition is the only uniform that’s common to the VS and FS, hence the InfoLog only has two error messages, one for the VS and another for the FS.
Not sure why you are seeing junk coming from the shader log, though. Which driver and device are you using?
Also the Adreno 220 has a limit of 512 shader instructions (VS + FS)
Mac and Linux ports of our tools will be coming soon.