Getting back reversed data with GL_RGBA?

Regarding this paragraph:

If I want to read back pixels in RGB order from an off-screen render-to-texture buffer, such as a FBO:
glReadPixels( 0,0, w,h, GL_RGBA, GL_UNSIGNED_BYTE, buffer );

Is it always guaranteed that I will get a buffer in RGB order using GL_RGBA?
Or will the driver be sneaky and send back the data as BGR in some cases?

It is guaranteed but it is slow.

Make a copy to another FBO using fragment shader that reorders the R,G,B,A channels.
Then use glReadPixels with GL_BGRA.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.