PBuffer ReadBack Woes

I have a 16-bit depth PBuffer (two rendering contexts) in a glut program
and after rendering to the PBuffer with a 16-bit float texture I read back into another 16-bit float texture using glCopyTexSubImage2D(), however , the results are unpredictable and make
little sense. I see part of the texture but not the part I rendered to screen. I share textures between contexts and use a shared texture for read back. If I just copy to processor memory
using glReadPixels() everything is fine (the results are as expected). Also, if I use glCopyTexSubImage2D() in the normal glut rendering context it works fine. Any suggestions ?

Can’t say I’ve done anything with Float textures etc. but would having a 16bit pbuffer and trying to read a float array from it cause you problems? Floats are (on Win32) 32 bit and your buffer is either R4G4B4A4 or R5G5B5 or something like that…

Or am I way off target?

The buffer is a 16-bits per channel float format for a total of 48 bits (RGB). I
get part of the result out just not the part
of the texture I rendered…?

Gibby: Not sure what the problem is. If you’re running this on NVIDIA hardware and have something you could send me, feel free to do so. I’ll take a look at it, but it might take a little while to get to it if the problem isn’t obvious.

One thing to keep in mind is that when you use multiple contexts that share textures, textures are basically the only thing that’s shared. If you set GL state in one context, don’t do anything that expects the state to be set similarly in the other one. This may well have nothing to do with your problem, but it’s a common problem to have.