2.6.8. Processing pipeline

The following efficiency considerations relate to the graphics processing pipeline:

Use eglSwapBuffers

If your application displays animations, ensure your application terminates the specification of a frame, and starts processing it, by calling eglSwapBuffers(). The application then produces the next frame. This process ensures that a stable image remains on the display while the next frame is being computed.

Avoid using glReadPixels

Avoid using glReadPixels. This greatly reduces performance, even if a small number of pixels are read, because it stalls the processing pipeline.

When the GPU has started to process the current frame, the driver must stall until the processing completes before the result can be returned to the application.

Limit number of vertices that glDrawElements processes

After a call to glDrawElements(), polygon list building cannot start until the preceding step, vertex shading or transform and lighting, has been completed. To enable these units to work in parallel, ensure that no single call to glDrawElements() comprises more than approximately one fifth of the total number of vertices in the frame. This is especially important for calls immediately before or immediately after a call to glDrawArrays().

Note

  • On desktop OpenGL systems, using glDrawArrays instead of glDrawElements can sometimes reduce the latency between the API calls and the final image appearing on the display. However, the Mali GPU uses deferred rendering. This means that rendering does not start until all geometry for a frame has been specified.

  • Deferred processing and the pipeline nature of the Mali GPU implementation results in some latency. Typically, three frames are in various stages of processing while a fourth is displayed. At rates below 20 frames per second, you might notice a delay between a button being pushed and observing a reaction in the image. So, if you want a very fast-moving game, either simplify your scene, or optimize processing to get a higher frame rate.

Copyright © 2007-2009 ARM. All rights reserved.ARM DUI 0363D
Non-Confidential