I've been working on the assumption that I can use multiple shader objects and link them all together to create a program. I have a single vertex shader with a main() but 2 fragment shaders, one with a main() and the other without (but defines a function which the main() shader calls). This works perfectly under desktop emulation, but I've just tried it on a Zoom LPD3430 and the shader compiler fails with:
ERROR: main() function is missing.
ERROR: 1 compilation errors. No code generated.
It's absolutely correct, the main() function IS missing - it's in the other object.
Surely this is supposed to work??
Hi Tom,
TomCooksey wrote:
Surely this is supposed to work??
Actually it isn't, and the fact that it works in PC emulation is a bug. We'll have a look at this, thanks for reporting. OpenGL ES 2.0 doesn't allow multiple shader objects of the same type to be attached to a program object. From the ES 2.0 spec:
Quote:
Multiple shader objects of the same type may not be attached to a single program object.[...]The error INVALID_OPERATION is generated if shader is already attached to program, or if another shader object of the same type as shader is already attached to program.
Regards,
GeorgXmas2008-09-30 12:01:46