View Full Version : openGL: pbuffer in thread and nvidia

15th June 2010, 11:24

i have a programm which creates a pbuffer. i am starting a thread and using this pbuffer to render a scene and saving it a dynamic texture.
the application accesses this texture to draw it. i am using this to achieve asynchronous rendering.

using this method with ATI graphiccards work fine.
but using nvidia graphiccards the scene is only rendered once. any further manipulation does not affect the dynamic texture. it seems that the pbuffer can only be written once.
once i remove threading (but keep every as is) it will work fine.

anyone can help ?

Qt 4.6.2
windows (tested: XP, vista, 7)
nvidia (tested one 3 different cards)

25th June 2010, 07:43
noone got any idea ?

25th June 2010, 13:33
How are you updating the pbuffer from other threads, specifically, are you trying to allocate textures in those other threads and render to the pbuffer because it may be something specific with pbuffers and nvidia's opengl impl where things which receive device id's such as texture id's or glx ids can only be created in the main thread but manipulated from others, if you are creating them from other threads typically this crashes the thread.

25th June 2010, 16:09
the pbuffer is created and initialized with oGL settings in the main thread. it is also bound to a dynamic texture in the main thread.
the thread does:
- switch context to pbuffer (main thread will not get context until rendering is done: locked)
- render scene
- update dynamic texture (if auto update is not available) (also tried to force an update)

once the thread is done the main thread will print the scene:
- switch context to main
- print dynamic texture

the thread never crashes