View Full Version : "asynchronous readback" that call "glReadPixels()" with PBO

11-29-2005, 09:31 PM
Is there any performance advantage that use "glReadPixels()" with PBO than use "glReadPixels()" lonely?The performance advantage I said is higher readback speed,or lower CPU usage.I use NVSDK's "PBOTest" demo to test my computer(P4 3.2G+NV7800GT),I found there is no readback speed advantage that use "glReadPixels()" with PBO than without,in fact the speed is equal,But I don't know whether there is a CPU usage advantage.

I know the main distinguish use "glReadPixels()" with PBO or without is asynchronous readback,if I call glReadPixels with PBO,the function will be returned immediately without waiting for rendering over,but my program has multi threads,while "glReadPixels()" is doing,only the OpenGL rendering thread is stalled,other threads are in working,such as process the image read back before,I think my multithread method has the same function of asynchronous readback,the "asynchronous readback" provided by OpenGL has no use in my program.

It is all my guess,I also think "asynchronous readback" may has other benefits than multithreads,I hope some suggestion or corrections,thanks!

11-30-2005, 06:49 AM
Hi Pango,

Syncrhonous glReadPixels() causes the whole command buffer and GPU to completely flush. It will take some time to begin feeding more commands to the GPU and have it operating at full efficiency again. In graphics-limited applications, these synchronous reads can hurt performance if they're done too frequently, even if you do have a dedicated graphics thread.

Asynchronous reads allow both the CPU and the GPU to operate at fully pipelined efficency.

Thanks -