Messed up frame buffer on device


I’m porting an application from windows mobile to Symbian S60_5th devices and are having some troubles with the rendering. The engine and framework itself seem to be very robust and comes from a very renowned source which can’t be disclosed due to NDA, which is also why I can’t supply any screenshots of the problem or code. But I will try to explain the symptoms and hopefully someone might recognize it, and the most common cause.

This project is rather GPU heavy in mobile-terms, average triangle count around 250k/frame, indexed VBO’s. We’re using ~4mb uncompressed mipmapped textures in the scene and a set of rather heavy shaders. It’s not meant for speed.

This application if written for GL|ES 2.0, and it runs perfectly well on a PC using the PowerVR MBX1 driver.

On device however, the Samsung I8910 with PowerVR SGX 530, something’s not quite right…

The problem I’m experiencing is that sometimes, the frame buffer gets all messed up during rendering, sometimes it looks like the tiles are all shuffled, with some tiles showing previous frames while some tiles show the current frame. Other times the frame buffer just collapses on itself into an ever repeating mess of black and green garbage.

At first I thought this was all caused by the shaders since they where all written to exclusively use medium precision on all attributes, varyings, uniforms and local variables. And from the start we also had problems with missing triangles in meshes, and this error was in fact caused by the position attributes and transform uniforms in the shaders had too low precision. So the first step I did was to make sure all shaders was using high precision for everything to rule out that as an error. Which also proved to be good since all the triangle-related errors was now gone.

The frame buffer glitch still remains, though less frequent.

The next thing I tried was to simplify all the fragment shaders to simply return a constant color and virtually do nothing else, but that didn’t do anything.

I’ve also tried to eliminate all use of additional frame buffers, since the application by default makes use of frame buffer effects such as fullscreen radial blur which could be a potential source of the error. But that still didn’t make any difference, in fact, it glitches less if I draw to a 512x512 render buffer before I draw that render buffer target on a quad to the default frame buffer.

I’m all out of ideas.



The problems with precision wrt your geometry are unsurprising - raising everything to highp should eliminate this, like you say. You should be able to use lower precisions for other variables, but in our experience the actual vertex projection calculations need to be done at highp.

Regarding the framebuffer corruption and things to try:

- can you run a scene with far fewer vertices; say <2000?

- can you replace your very large textures with much smaller or even trivial ones?

- rendering your 512x512 buffer without the initial render presumably works ok?

If none of these tests remoes the corruption then is it possible for you to send us a simple example, in different source code that isn’t under NDA, but that still reproduces this problem to Gordon2009-11-17 14:25:57