> I have spent a couple of days trying to get a program
> to render geometry in one thread, and parse and
> glBind images in another under Mesa without success.
You're going to need to work out the cross-thread context management
stuff before that will work.
>>... I'd redesign this program so that there is only one
>>OpenGL context that is shared by the two rendering threads, rather than
>>having each thread create its own OpenGL context.
> Now, this I have tried without success. Anyone have an
> idiots guide to sharing a context between threads?
The OpenGL documentation is weak in this area (man glXMakeCurrent, and
the GLX chapter in the Red Book). I'll give you a hint that will help to
fill in the gaps: When one thread is finished with the context, it
needs to "detach from the context." E.g., glXMakeCurrent(dpy, window,
NULL). The thread relinquishing control of the context needs to do so
before the other thread makes it current prior to drawing. The context
"exchange" needs to be protected by a mutex so that you don't have
multiple threads concurrently mucking with the context. This approach
will reliably work, I promise. If its not working, it's because of
Wes Bethel -- R3vis Corporation -- voice (415) 898-0814 -- http://www.r3vis.com