View Full Version : Same framebuffer multiple contexts

05-16-2010, 02:43 PM
I have two contexts running in their own individual threads and accessing the same framebuffer. If fails in an odd way for me. When I debug the code, the bindFrameBuffer call does not cause immediate trouble, but a subsequent call to any opengl function does. Currently the failing function if glGetError.

What I am trying to do is to render and swap in one thread and while it renders to the backbuffer, I am copying out pixels from the frontbuffer and sending them to another device.

The framebuffer I am trying to share this way is an extra framebuffer that I created myself (id=1) for offscreen rendering.

Is there a problem with this sharing?

05-16-2010, 11:30 PM
Use one context and PBO for reading

05-17-2010, 05:44 AM
framebuffer objects (FBO) can not be shared. But textures used to build a FBO can be shared.

ref: Spec 4.0, appendix D, Shared Objects and Multiple Contexts, page 389: "Framebuffer, query, and vertex array objects are not shared"


05-17-2010, 01:26 PM
Ok. Sharing the texture into which the framebuffer writes graphics, that is just as well. Thanks for the pointer.