Ville Syrjälä
2012-08-07 18:23:44 UTC
Some time ago I started fiddling around with SDL. I didn't even want to
think about using the pvr2d stuff, so I decided to implement hardware
acceleration using EGL/GLES2.
I took some version of the harmattan SDL port, removed the pvr2d stuff,
and added the EGL/GLES2 stuff to the X11 video code. It's not very
cleanly added, and I'm sure there are various issues with window
re-creation and whatnot.
Features:
- EGL/GLES2 based, no pvr2d stuff
- Always uses a shadow buffer, because preserved flips aren't supported on
the platform.
- Automagically scales the application content to fullscreen using the GPU.
- Software access to hardware surfaces implemented with glFinish() and
EGL_KHR_lock_surface. I initially tried to use EGL_KHR_fence_sync instead
of glFinish() but there seemed to be some flushing bug left in the driver
causing problems. glFinish() should be OK on pvr, but on some other
hardware it could be a problem. So it's not the most portable solution.
- Supports color keyed and alpha blended blits. Only color keying has
actually been tested.
- some SDL tests, uqm and scummvm seem to work reasonably well
The code is here [1] in case anyone is interested. It was languishing on
my hard drive already for some time, and since I wasn't able to motivate
myself to work on it further, I decided to set if free as is. The git
history is a bit of a mess, but ATM I'm too lazy to clean it up.
[1] https://gitorious.org/harmattan-sdl/sdl
think about using the pvr2d stuff, so I decided to implement hardware
acceleration using EGL/GLES2.
I took some version of the harmattan SDL port, removed the pvr2d stuff,
and added the EGL/GLES2 stuff to the X11 video code. It's not very
cleanly added, and I'm sure there are various issues with window
re-creation and whatnot.
Features:
- EGL/GLES2 based, no pvr2d stuff
- Always uses a shadow buffer, because preserved flips aren't supported on
the platform.
- Automagically scales the application content to fullscreen using the GPU.
- Software access to hardware surfaces implemented with glFinish() and
EGL_KHR_lock_surface. I initially tried to use EGL_KHR_fence_sync instead
of glFinish() but there seemed to be some flushing bug left in the driver
causing problems. glFinish() should be OK on pvr, but on some other
hardware it could be a problem. So it's not the most portable solution.
- Supports color keyed and alpha blended blits. Only color keying has
actually been tested.
- some SDL tests, uqm and scummvm seem to work reasonably well
The code is here [1] in case anyone is interested. It was languishing on
my hard drive already for some time, and since I wasn't able to motivate
myself to work on it further, I decided to set if free as is. The git
history is a bit of a mess, but ATM I'm too lazy to clean it up.
[1] https://gitorious.org/harmattan-sdl/sdl
--
Ville Syrjälä
***@sci.fi
http://www.sci.fi/~syrjala/
Ville Syrjälä
***@sci.fi
http://www.sci.fi/~syrjala/