It turns out there were two crash bugs. One affected all SGX based iPhones, and one was specific to the iPhone 5 / 5C. Since the 5 is SGX based and I didn't have one to test on, I blithely assumed that only one fix was needed.

The bug affecting SGX devices seems to be a problem with the graphics driver. Now that's up there with compiler bug as the thing you blame right before discovering you did something stupid, but in this case what I'm doing seems reasonable. In my cut down test case I can reproduce the crash by drawing 3 textured triangles at different orientations into a texture, with a viewport smaller than the target. This causes it to crash with gpus_ReturnGuiltyForHardwareRestart. Changing the angle of the triangles stops it crashing, as does reading from a fixed texture coordinate in the fragment program.

I couldn't find a satisfactory workaround, so I've disabled the transmissive lighting on SGX devices (meaning no texture read is needed in the troublesome case).

The iPhone 5 specific bug was a result of the way I set up the different quality profiles for Folding Paper. I want it to look as pretty as possible on every device, so I have a set of profiles specifying things like the amount of tessellation to use in curls, the number of light rays to accumulate for the lighting, the texture precision and so on. I have a pretty good sampling of iPhones and iPads of various ages, so I set up these profiles by testing with what I had, and interpolating for devices I don't have. I didn't have access to an iPhone 5, so I set it up to be somewhere between the 4S and the 5S. It turns out this was a bad choice - it's much closer to the 4S in performance. I also turned on floating point textures, to stop the banding in the shadows, but it turns out this is broken on SGX devices. (I'll look into why, but I suspect this one really is me doing something stupid.)

The new build uses a better profile for the 5, and I've tested it on a real phone so this time it will actually work.

If you really want to see Folding Paper at its best, an iPhone 5S or newer is the way to go.