Shared context problem

I am trying to create two contexts, context1 and context2 where context2 passes context1 as the sharedContext parameter of eglCreateContext. I started with the Hello_Triangles example from and added a second thread. I extended the CreateEGLContext function to create two contexts, context1 & context2. I also moved the call to Init from main to the thread function.

The example doesn’t work if context2 passes context1 as the “shared context” parameter of eglCreateContext but it does if I pass EGL_NO_CONTEXT.

I’ve attached the three files that I modified to this message.

Any ideas why the shared context doesn’t work?

Hi Jason,

[blockquote]I’ve attached the three files that I modified to this message.[/blockquote]
I can’t see your attachments. We’ve been having some issues with the attachment system lately, so it may be a problem on our side (I’ll chase up the web team about this). Would it be possible to host the files on another service, e.g. Dropbox or Pastebin, and share a URL with us?

We have a multi-threading demo in our SDK where a shared context is used to load resources on a background thread. You can find the source code for the demo here:

Apparently .c & .h files are also blocked. I have put them on DropBox.

Has anyone had a chance to look at the sample code that I posted on dropbox? I have looked at the multithreaded sample but there are some differences. For one, it doesn’t attempt to render on the second thread. Another difference that comes to mind is that the thread that creates the window and has the message pump is the same thread that does the rendering. For various reasons I can’t set mine up that way.

Hi Jason,

Apologies for the delayed response. I’ve replied to your email, but will continue posting updates in this chain so other developers can benefit from seeing the discussion.

From your email, it seems that you encountered this problem in our PVRVFrame emulator rather than PowerVR graphics drivers. I’ll ask the PVRVFrame lead engineer to take a look at the source code example you have provided.


I was using PVRVFrame version 10.1.

The PVRVFrame lead was able to reproduce the issue. Unfortunately, he hasn’t been able to isolate the cause. It’s unlikely we will have time to fix the issue for our upcoming 4.0 SDK. We’ve filed the bug as BRN57422 in our tracker and will aim to resolve the issue in a future release.