# share glprogram between contexts

**URL:** <https://forums.imgtec.com/t/share-glprogram-between-contexts/1890>\
**Category:** PowerVR Insider\
**Created:** [September 4, 2013, 12:54am UTC](https://forums.imgtec.com/t/share-glprogram-between-contexts/1890 "2013-09-04T00:54:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rory\_yin](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rory\_yin](https://forums.imgtec.com/u/rory_yin)\
**Post date:** [September 4, 2013, 12:54am UTC](https://forums.imgtec.com/t/share-glprogram-between-contexts/1890/1 "2013-09-04T00:54:38Z")

</div>

i am writing an APP to process video in IOS. i have a case that i will create two GPU threads with its own glContext to handle a sequential frames, the method to process of these sequential frames is the same, so i will have to create two same GL Programe for this two GPU threads, since compile and link GL program cause a lot of time, so i want to know if i can just create one programe and share this program between this two glContext? if it can’t, does powerVR driver has optimized this case? thanks!

---

<div class="post-metadata">

**Author:** ![arron](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@arron](https://forums.imgtec.com/u/arron)\
**Post date:** [September 4, 2013, 7:11am UTC](https://forums.imgtec.com/t/share-glprogram-between-contexts/1890/2 "2013-09-04T07:11:19Z")

</div>

Hi,  
  
Take a look at EAGLContext reference pages: [https://developer.apple.com/library/ios/documentation/opengles/reference/EAGLContext\_ClassRef/Reference/EAGLContext.html](https://developer.apple.com/library/ios/documentation/opengles/reference/EAGLContext_ClassRef/Reference/EAGLContext.html)  
  
  
  
Using the methods ‘sharegroup’ and ‘-initWithAPI:sharegroup:’ it’s possible to share two contexts together, sharing resources. Although the EAGLSharegroup docs do not explicitly state that programs can be shared, it is possible to achieve.

---

<div class="post-metadata">

**Author:** ![rory\_yin](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rory\_yin](https://forums.imgtec.com/u/rory_yin)\
**Post date:** [September 5, 2013, 12:32am UTC](https://forums.imgtec.com/t/share-glprogram-between-contexts/1890/3 "2013-09-05T00:32:25Z")

</div>

thanks for your kindly help.  
  
i know that EAGLSharegroup can help to share some resources like texture, render buffer, but i am not sure if the programs is also ok.
