# eglMakeCurrent cost much time

**URL:** <https://forums.imgtec.com/t/eglmakecurrent-cost-much-time/2347>\
**Category:** PowerVR Insider\
**Created:** [August 12, 2015, 5:56am UTC](https://forums.imgtec.com/t/eglmakecurrent-cost-much-time/2347 "2015-08-12T05:56:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgdeveloper](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@cgdeveloper](https://forums.imgtec.com/u/cgdeveloper)\
**Post date:** [August 12, 2015, 5:56am UTC](https://forums.imgtec.com/t/eglmakecurrent-cost-much-time/2347/1 "2015-08-12T05:56:44Z")

</div>

Hi,

I have one render thread, and in the thread, there are two surfaces and two contexts, one is ES 2.0 and another is ES 1.0, each renders on one surface.

I find when context switch from ES 2.0 to ES 1.0, the time is only 0.02ms; but context switch from ES 1.0 to ES 2.0 costs 4.5ms. I just call glClear in ES 1.0 and swapBuffers, do nothing else at all. (The context switch time only check before wglMakeCurrent and after it, not include render)

After I change ES 1.0 context to ES 2.0 context, the context switch time is ~ 0.02ms!  
It seems driver cost much time to switch context from ES 1.0 to ES 2.0.

I am wondering how to reduce the context switch time? Thanks！

The system info is as followings:  
PVRPerfServerDeveloper v14.75.2 - Build 3.3@2964572  
Copyright © Imagination Technologies Ltd. All rights reserved.

- Support: [DevTech@imgtec.com](mailto:DevTech@imgtec.com)
- OS: Linux version 3.14.31-00074-g742896e (jenkins@ubuntu76) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 SMP PREEMPT Tue Aug 11 14:37:24 CST 2015
- Time (local): Sat Jan 1 04:33:32 2000 (04:33:32)
- Time (UTC): Sat Jan 1 04:33:32 2000 (04:33:32)
- DRIVER BUILD: 1.9.225.3347
- Device Variant: PowerVR SGX544MP2
- Device Series: PowerVR Series5XT
- Processor count: 2

---

<div class="post-metadata">

**Author:** ![PaulLy](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@PaulLy](https://forums.imgtec.com/u/PaulLy)\
**Post date:** [August 18, 2015, 9:55am UTC](https://forums.imgtec.com/t/eglmakecurrent-cost-much-time/2347/2 "2015-08-18T09:55:23Z")

</div>

Switching between contexts is inherently slow, it is strongly recommended to avoid doing so whenever possible.
