Imagination PowerVR SDK Blog

eglMakeCurrent cost much time


#1

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
  • 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

#2

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