The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
eglWaitGL() on Android
Jorge Rodriguez
Guest

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 Smile

--
Jorge "Vino" Rodríguez
[ Tw | Fb | G+ | Ht ]
eglWaitGL() on Android
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
I was waiting for the 2.0.3 release to happen to remove these lines (at least temporarily), and then forgot about it Smile ...I'll remove them ASAP.

Gabriel.


2014-04-17 5:25 GMT-03:00 Jorge Rodriguez:
Quote:
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 Smile

--
Jorge "Vino" Rodríguez
[ Tw | Fb | G+ | Ht ]








--
Gabriel.