I'm writing a piece of software involving OpenGL ES 2.0. It's just about presenting photos with some addon special effects using GLSL.
Everything worked fine and the shaders performed well on iPhone 4, iPhone 4s and iPhone 5 with IOS7. But when I tested the software with an iPhone 5S with IOS7 installed, OpenGL only gives me the clear color (able to change with glClearColor) for all the GLSL shaders I wrote. Not able to work on the latest device is certainly not acceptable.
Another abnormal phenomenon on iPhone 5S is that every first call to glDrawElements (I'm using VBO if that matters) after the used opengl program is compiled (a new opengl shader program is compiled each time the user switches the special effect), will block the current thread for about 10 seconds.
I tried to compile with XCode 5 and 4.6, and both gave the same result (Fine on all devices other than iPhone 5s).
The project work on IOS7 installed on iPhone 5, so the problem shouldn't be the os version or SDK version. I suspect that the new GPU might be the cause, but I have no idea of how to fix it or even test out where in the code is failing. It took me a whole day to only finding out that glDrawElements issue.
The code of the software is huge and it's impossible for me to post all it in my question. I will be grateful if anyone can provide me with some help or just some idea.
To make the question more consice, my OpenGL shaders seems to fail on the latest iPhone GPU. So I'm wondering if:
- The latest Apple A7 GPU cut off supports to some OpenGL ES 2.0 features
- There are some limitations on creating vertex buffer objects (vbo) with iPhone 5s
- The use of RenderBuffer, FrameBuffer and TextureBuffer (used to perform multipass shader) have any difference on iPhone 5s
These are all the suspicious part I can think of now, but I have no idea how to test them, because I'm not getting even one rendered frame by now.
glDrawElements (...)
, the number of seemingly unrelated operations that are finally committed when you make a draw call would surprise you. It probably has nothing to do with your vertex data, and everything to do with resource allocation / validation.