Problem with pbuffer and CopyPixels

I’m using a pbuffer for some off-screen rendering so I can store some intermediate results and reuse them in a later frame. I need both the color and depth buffers copied over to the main gl window.

Unfortunately, when I do this:

GLint v[4];
glGetIntegerv(GL_VIEWPORT, v);

wglMakeContextCurrentARB(myHDC, pHDC, mycontext);
glCopyPixels(v[0], v[1], v[2], v[3], GL_COLOR);
glCopyPixels(v[0], v[1], v[2], v[3], GL_DEPTH);
wglMakeCurrent( myHDC, mycontext);

It crashes on the first CopyPixels in nvoglnt.dll
myHDC and mycontext are associated with the original gl buffer, while pHDC is the handle to the pbuffer display context.
I checked and the wglMakeContextCurrentARB call returns true, so I’m at a loss about what to try next.

This works fine:

  1. Binding the pbuffer
  2. Drawing scene
  3. ReadPixels to a char array in memory
  4. Binding original gl buffer
  5. DrawPixels
    but of course, this isn’t what I want: it’s pretty slow and doesn’t really need pbuffers to get it working anyway.

Does someone out there have working code that does this kind of operation that they could give me or help me get pointed in the right direction? I’m running on a GeForce FX 5900 with the 61.77 drivers.

After some more research (from this post ) and doing some tests for myself, I found that I get the crash in the drivers if I try to use copy pixels from a single or double buffered pbuffer to a double buffered normal opengl buffer.

I assume this is a driver bug since I don’t know of anything in the spec that says I can’t do this, but if anyone else has any insight, I would appreciate the input.