PDA

View Full Version : glxCreateContext sharing textures...



147-2
05-20-2008, 02:42 PM
I have noticed that glxCreateContext allows the sharing of textures between two contexts. I have a few questions for anybody that has knowledge in this department.

If context A, in thread A were to write into a texture, would context B in thread B somehow "step on A's toes" if it were to try to render using that texture? Would I have to implement some sort of locking to get it to work?

Another thing, might it be more efficient than passing a buffer from one thread to another, and sending it to texture there, within one context?

Thanks a lot

Rob Stoddard

Dark Photon
05-21-2008, 05:49 AM
If context A, in thread A were to write into a texture, would context B in thread B somehow "step on A's toes" if it were to try to render using that texture? Would I have to implement some sort of locking to get it to work?
Yes.
Parallel OpenGL FAQ (http://www.equalizergraphics.com/documentation/parallelOpenGLFAQ.html)

You can fill buffers in another thread, but it's best to keep only one thread talking to OpenGL. That avoids all the locking and sharing overhead.