I want to use two PBOs to read pixel in alternative way. I thought the PBO way will much faster, because glReadPixels returns immediately when using PBO, and a lot of time c
BGRA is the fastest since this is the native format on modern GPUs. RGBA, RGB and BGR need 'reformatting' during readback.
I do not know glutInitDisplayMode
by heart, but this typically is because your internal and external format do not match. For example, you won't notice the asynchronous behaviour when the number of components do not match because this conversion still blocks the glReadPixels
.
So the most likely issue is that with glutInitDisplay(GLUT_RGBA)
you will actually create a default framebuffer with an internal format that's actually RGB
or even BGR
. passing the GLUT_ALPHA
parameter is likely to make it RGBA
or BGRA
internally, which matches the number of components you want.
edit: I found an nvidia document explaining some issues about pixel packing and performance influence.
edit2: The performance gain of BGRA
is likely because the internal hw buffer is in BGRA
, there's not really much more to it.