I’m developing an application that uses glReadPixels(). I was wondering if there is any information available about how the function performs with respect to different sized readbacks. For example, how much faster will a 10x10 readback be, compared with a 100x100 readback? Does it make any difference?
Fist of all, consider using the PBO(pixel buffer object) extension with readbacks.
To your actual question: 10x10 may be faster then 100x100, but the only way to find out is to benchmark it yourself. The second case will be transporting 100 times more data then the first case, but it doesn’t mean it will be 100 times slower (as there is some driver operation overhead). The actual result will depend on the implementation.
Still, with modern cards and up-to-date drivers a 100x100 readback should be very fast.
Readback speed can also depend on the color channel ordering. If the the implementation has to touch the data to reoder it from native to user defined ordering the readback will be slower than if it remains in the native ordering. As said above, it’s rather implementation dependend.