Sign in to follow this  
longlong9

eglmakecurrent is so slowly in android

Recommended Posts

longlong9    130
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 !

Share this post


Link to post
Share on other sites
SimonForsman    7642
[quote name='milaoshu1982' timestamp='1348711067' post='4984191']
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 !
[/quote]

Don't do it every frame. (As long as its always the same thread executing the rendering you only have to call it once)

Share this post


Link to post
Share on other sites
longlong9    130
i have tryed just do once,it is run.but i need render one frame to two window. so i must eglmakecurrent(display , null , null .....).when render one frame is end.

and it is not happened in ios, it is odd

Share this post


Link to post
Share on other sites
Koehler    228
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this