PDA

View Full Version : FBOs - shared or no in OpenGL 3.3?



JoshKlint
10-23-2010, 04:33 PM
My inclination would be to make them shared, but this seems to indicate they are not? What's the story?:
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=270293

If they aren't shared, is there any cost of calling wglMakeCurrent()? I already use a background hidden window context to share all contexts with, so I could just create FBOs on this persistent context and switch to it whenever I render to an FBO.

JoshKlint
10-23-2010, 09:39 PM
I am having good results switching to the persistent hidden context whenever an FBO is used. Hopefully there will be something I can do like that on Mac and Linux.

mfort
10-24-2010, 12:03 AM
FBO cannot be shared.
FBO does not consume resources, replicate the FBO in all your contexts and use it.

JoshKlint
10-28-2010, 11:25 AM
Yeah, but then you have to have a map to look up the FBO by context and you have to set it up and check it each time it is used in a new context, and then clean it up when a context is deleted. It's unnecessarily messy.

mfort
10-28-2010, 11:29 AM
Yes, it is harder. But there is no other way. You can also use thread local storage if you have 1 context per one thread.