eglWaitGL() on Android

Hello all,

First of all I’ve only just started using SDL so apologies for any
unfamiliarity with the library or the team.

In Android_GLES_SwapWindow() SDL calls eglWaitGL():

http://hg.libsdl.org/SDL/file/0eed6a72e3c1/src/video/android/SDL_androidgl.c#l41

which the docs say is equivalent to glFinish:

https://www.khronos.org/registry/egl/sdk/docs/man/html/eglWaitGL.xhtml

So the question is, should SDL really be calling glFinish every frame?

I noticed it while trying to figure out why SDL_GL_SwapWindow was blocking
for 100ms every frame. It was eglWaitGL’s fault, but when I commented that
out, eglSwapBuffers started blocking instead. This tells me that eglWaitGL
is behaving like glFinish and will stall the pipeline every frame. I’m not
sure that’s what most people want out of SDL_GL_SwapWindow.

Turns out I’m just sending way too much to the driver, and I have some
optimizations to do, meaning this isn’t a perf problem for me right now but
shakesoda in IRC said s/he does see perf problems in other situations. In
the meantime jorgen asked me to post so here I am :)–
Jorge “Vino” Rodr?guez
[ Tw http://twitter.com/vinobs | Fb http://www.facebook.com/bsvino
| G+http://www.google.com/profiles/bs.vino|
Ht http://vinoisnotouzo.com ]

I was waiting for the 2.0.3 release to happen to remove these lines (at
least temporarily), and then forgot about it :slight_smile: …I’ll remove them ASAP.

Gabriel.

2014-04-17 5:25 GMT-03:00 Jorge Rodriguez <bs.vino at gmail.com>:> Hello all,

First of all I’ve only just started using SDL so apologies for any
unfamiliarity with the library or the team.

In Android_GLES_SwapWindow() SDL calls eglWaitGL():

http://hg.libsdl.org/SDL/file/0eed6a72e3c1/src/video/android/SDL_androidgl.c#l41

which the docs say is equivalent to glFinish:

https://www.khronos.org/registry/egl/sdk/docs/man/html/eglWaitGL.xhtml

So the question is, should SDL really be calling glFinish every frame?

I noticed it while trying to figure out why SDL_GL_SwapWindow was blocking
for 100ms every frame. It was eglWaitGL’s fault, but when I commented that
out, eglSwapBuffers started blocking instead. This tells me that eglWaitGL
is behaving like glFinish and will stall the pipeline every frame. I’m not
sure that’s what most people want out of SDL_GL_SwapWindow.

Turns out I’m just sending way too much to the driver, and I have some
optimizations to do, meaning this isn’t a perf problem for me right now but
shakesoda in IRC said s/he does see perf problems in other situations. In
the meantime jorgen asked me to post so here I am :slight_smile:


Jorge “Vino” Rodr?guez
[ Tw http://twitter.com/vinobs | Fb http://www.facebook.com/bsvino |
G+ http://www.google.com/profiles/bs.vino | Hthttp://vinoisnotouzo.com]


Gabriel.