pbuffers and glTexSubImage2d

rebelr6

Newcomer
Hello,

I'm new to the forums, but I wondered if anyone would have any insight in a problem that's confounded me for days.

I'm doing an effect which requires copying the framebuffer to a texture (using glCopyTexSubImage2D) which is then drawn to a pbuffer for further processing, after which the result is drawn back to the framebuffer (by using the pbuffer as a texture).

The problem I'm having is that it is extremely slow (5fps). I've isolated the problem to this small sequence of events.

1. Do the CopyTexSubImage on framebuffer
2. Switch rendering context to pbuffer (via wglMakeCurrent)
3. Switch rendering context back to framebuffer (via wglMakeCurrent)

Without doing ANY actual drawing whatever, just these 3 steps, my frame rate plunges to 5fps.

I am creating the pbuffer with its own GL rendering context, but as an experiment, I tried to use the existing gl context (had to change the pbuffer to a compatible format) but it was still 5fps. The framebuffer texture is 1024 by 1024 in RGBA8 format (with no mipmaps), so I can't a lack of hardware support there.

The thing is, copying the framebuffer on its own without manipulating the pbuffer is very fast (~300fps). Also, changing context to the pbuffer on its own WITHOUT doing the copy is also very fast (~300fps). Doing both together is 5fps.

As another experiment, I tried changing the read context to the framebuffer and write context to the pbuffer individually, using wglMakeContextCurrentARB, then doing the glCopyTexSubImage, but I had the same result.

I'm using a ATi 9500 Pro with the catalyst 3.6 driver set.

Any help on this would be greatly appreciated.
 
Back
Top