Hi,
Hi,
What surface are you reading from, is it a renderbuffer or a texture? What format does it have? How are you measuring the transfer rate? Note that glReadPixels implicitly flushes rendering to the surface you’re reading from, so the time required for glReadPixels may include the whole render pipeline latency.
Hi,
Do you specify format and type as (GL_RGB, GL_UNSIGNED_BYTE), or (GL_RGB, GL_UNSIGNED_SHORT_5_6_5)? Are the texture dimensions powers of two? Do you actually use it as a texture, or could you use a renderbuffer instead? What are you using the pixel data for?
I have tryid both, SHORT_5_6_5 and BYTE. I have noticed that reading back as SHORT_5_6_5 is little bit faster. The dimensions haven’t been always powers of two. What I’m doing is sort of general programming (GPGPU) and the resulting pixel data is not for display.
Yes, 565 should be faster as it needs less bandwidth. If you don’t need to use the data as a texture you should try using a renderbuffer. Textures typically use a different memory layout thus reading from them may be slower.
Regards,
Georg