A primer on on porting openGL based applications to GLES, and performance

There have been many queries on porting mesa3d to support gles api
with egl. There are even more queries on how to port other engines to
support GLES APIs. There are a couple of reasons why people want to do
this. It could be out of academic interest, or it could be because we
believe that usage of the PVR drivers will dramatically improve the
performance of the graphics/windowing system using mesa3d. I will try
to touch upon both these queries in this thread:

What does it take to port mesa3d, or any other engine that supports
openGL on the PC, to move to openGLES ?

1. Ensure that someone has not done the GLES port before you.

More likely than not as happens in opensource, this code might simply
be hiding in a trunk somewhere in the development tree. Search hard.
This is the case for OGRE3D. This is becoming the case for Mesa3D,
where gallium3D is already making inroads into the mesa3d branches,
with egl support.

2. Identify library dependencies:

Most of these subsystems, are designed with the PC in mind. Atleast
some libraries need to be cross compiled for the ARM environment. This
is a fairly simple step.

3. Identify if the engine/subsystem is capable of querying for
"capabilities" of the target device

Quite a few of the engines do this. For example, OGRE3D has a neat
mechanism of querying the features the HW supports, and enables them
only based on the available HW features. Many other engines/subsystems
like Mesa need to be manually changed to retarget to OpenGL ES. This
can be painful, but it is still a time bound task.

4. Identify what target windowing systems are needed to be supported.

The PowerVR drivers in the OMAP3 Graphics SDK support a null windowing
system, and a sample X11 windowing system. QT/E supports the PowerVR
drivers. In the future, we will look at support for other major
windowing systems. You need to look at what system your application
requires.

5. Findout the input interfaces.

Okay, you solved the backend problem, but some of the engines demand a
specific input support. For example the Ogre3d on Linux needs OIS.
Ensure this is available.

What timelines are we looking at ? Typically, if you are focused
enough, a first cut version of the above should be done in a months
time or so.

Now, lets look at the next question.

If you are seriously interested in looking at improving the
performance using the PowerVR drivers (using the GLES api), understand
that due to the nature of the hardware (highly parallel), the
acceleration you would expect for typical windows, is going to be
minimal. PowerVR is specifically designed to accelerate 3D. There are
other ways in which you can use the PowerVR engine that can help the
cause, and we are analysing the various use cases and the benefits
they bring for the use case.

Use this thread to post your comments.