I have the same problem right now, my program is much much simpler.
I think it relates to the count of temporary registers Agal has to use to compute your program. You can get it by looking at AGALProgramPair.vertexProgram.temporaryRegisterCount.
In the doc you can read, that if its over 8, the program.upload() will fail. But that not exactly true. Even some shaders with more than 9 registers are working while my program I have the problem with just uses 4 if I get it right. I just havent found out what exactly makes the change.
As soon as Iam using one float4x4 that is not a parameter and maybe one additional float4, its over. Even if I have under 8 temporary registers. Iam stucking for hours on this.
thanks, I have look at AGALProgramPair.vertexProgram.temporaryRegister, it is 4.
Ok, thats bad. To be honest, I have no idea how to fix this problem. Im stuck with this for 3 days now, cant getting my shader to work the way I want to.
I hope someone else has an idea.
It's almost certainly runninng out of registers. The number of temporary registers available is very very limited and float4x4 fills them up very quickly.