share glprogram between contexts

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!

Hi,

Take a look at EAGLContext reference pages: 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.


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.