Getting back reversed data with GL_RGBA?

Regarding this paragraph:

http://www.opengl.org/wiki/index.php/Common_Mistakes#Unsupported_formats_.234

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.