View Full Version : Test your card's PBuffer readback speed

12-08-2003, 12:47 AM
Hello everyone,I found the PBuffer readback speed is very difference between ATi and NVIDIA card.I write a short program to test it,the result shows the ATi card has higher performance than NVIDIA.Because I only do my test in a ATi Radeon 9800SE and a NVIDIA GF5200,so I'm not sure whethere the result is correct.So I post my test program's code(based Glut),and the result I had get,I hope you can do the test on your machine,and also post the result you get,and your opinion about the problem.

#define WIDTH 512
#define HEIGHT 512
#define REPEAT 30
CPBuffer pbuf; // a "PBuffer" object class,you can create a pbuffer by raw OGL command
void testAGPSpeed()
LARGE_INTEGER frequence,start,end;
for (int i = 0; i<REPEAT; i++)

double perf=(double)(end.QuadPart -start.QuadPart)/(double)frequence.QuadPart;
perf /=REPEAT;
perf = 1.0/perf;
printf("%f copies/sec\n", perf);
perf *= WIDTH*HEIGHT*4;
perf /= 1.0e6;
printf("%f Mbytes/sec\n", perf);

int main(int argc, char* argv[])
glutCreateWindow("AGP Speed Test");
return 0;

Below is my test result:
ATi Radeon 9800SE: 86.507644 copys/sec,90.709838 Mbytes/sec;
NVIDIA GF5200: 3.766799 copys/sec,3.949775 Mbytes/sec(too slow,let me surprise);

12-08-2003, 02:51 AM
My results confirm your bad NV perf :
readpixels from pbuffer :
3.661250 copies/sec
3.839099 Mbytes/sec

From normal framebuffer it seems to be ok:
99.716922 copies/sec
104.560771 Mbytes/sec

EDIT: GeForce 3 Ti200 , Detonator 45.23

[This message has been edited by ZbuffeR (edited 12-08-2003).]

12-08-2003, 03:02 AM
I have also had problems with the pbuffer.
I hope I am not off topic, but a glClear
in the pbuffer would make the framerate drop
substantially. However, if I replaced the clear with drawing a polygon that covers
the whole pbuffer and setting glDepthFunc to GL_ALWAYS, the framerate was normal.

Thus, given that the functionality of both functions is the same and they yeld such big differences in the framerate, I'll consider this a driver bug.

I know that this is different than reading from the pbuffer, but it is a "fillrate like" problem too.

12-08-2003, 07:46 AM
Originally posted by fuxiulian:
However, if I replaced the clear with drawing a polygon that covers the whole pbuffer and setting glDepthFunc to GL_ALWAYS, the framerate was normal.

That is true that glClear is slow on pbuffers. However, I tried your 'fix', but got no improvement, it is a little bit slower than the glclear.
e.g. in Geforce3 :
glClear(color and depth):37 fps

Which video card did you used ?

12-08-2003, 10:01 AM
I recently had a similar issue on a GeForce 5600. Surprisingly, an easy workarround was to define WIDTH and HEIGHT as 511 (or as another non-power-of-two value).

Disregarding this driver anomaly (?), graphics hardware from NVidia is generally faster than ATI's for reading back pixel data from the frame buffer or the pbuffer.

12-08-2003, 12:33 PM
Here it works, same as my last test, Geforce3 :
101.629256 copies/sec
106.565999 Mbytes/sec

In fact, I had to set NO PARAMETERS for the pbuffer, and particularly avoid those two :

Thanks to MattS for the solution, see this thread : http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/010964.html

(by the way, the 511x511 changed nothing)