hello everyone ,i has a problem ,that when i display one frame in a thread,find that there will be cost a large time.
when eglmakecurrent(display , null , null .....).
i do it in a thread timer , call it by 40ms.
is anyone have the same problem,can you help me ,thank you !
eglmakecurrent is so slowly in android
Started by milaoshu1982, Sep 26 2012 07:57 PM
3 replies to this topic
Sponsor:
#2 Members - Reputation: 3715
Posted 26 September 2012 - 11:45 PM
hello everyone ,i has a problem ,that when i display one frame in a thread,find that there will be cost a large time.
when eglmakecurrent(display , null , null .....).
i do it in a thread timer , call it by 40ms.
is anyone have the same problem,can you help me ,thank you !
Don't do it every frame. (As long as its always the same thread executing the rendering you only have to call it once)
I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
The voices in my head may not be real, but they have some good ideas!
#4 Members - Reputation: 190
Posted 27 September 2012 - 09:40 AM
I can't say for sure that this will work on Android, but you could try to handle this by running two threads, making once context current on each at initialization, and synchronizing them so they do not attempt to draw at the same time (via a semaphore). That should avoid the eglMakeCurrent overhead, and synchronization should minimize pipeline stalls due to rendering from separate threads. Do not try to draw from both at the same time, as that will cause a great deal of slowdown.
Edited by Koehler, 27 September 2012 - 09:41 AM.






