PDA

View Full Version : read buffer crashes in separate thread (nvidia)



ivokwee
01-27-2004, 04:17 AM
Now here is something weird. If am reading the buffer (either front or back) using glReadPixels in a main thread everything is OK. If I read the buffer in a separate thread, it crashes immediately at this function. An older NVidia driver 4191 did not crash, but only newer (from 4496 onwards) crash. Is this an NVidia problem? Or should reading buffer only be done in the main thread program? Really weird...

Ivo

zeckensack
01-27-2004, 05:48 AM
A gl context can only be current to one thread.
Why are you doing that anyway? Read pixels will block, there's no way around that.

jwatte
01-27-2004, 11:39 AM
I think he believes that he can ReadPixels in one thread, and keep rendering in another thread.

Alas, that's not true. A context can only be current in a single thread at a time, and another thread trying to make the context current will (typically) block until it can make the context current, so the first thread has to first give up the context.

If you want asynchronous pixel reading, NVIDIA has a current extension called NV_pixel_data_range (or something very similar).