Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Performance issue in GLES20.glreadpixels in android?

  1. #1
    Newbie Newbie
    Join Date
    Sep 2014
    Posts
    1

    Performance issue in GLES20.glreadpixels in android?

    Is there any way to improve the performance of glreadpixels in android? Is there any other way to read the display data to convert to image in openGL?

    Thank you.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,213
    If you want to convert the screen image to a texture, then glCopyTexImage and glCopyTexSubImage are the preferred ways. The copy will be carried out by the GPU and shouldn't involve any round-tripping, read-backs or synchronization.

    If you just want to read back the screen pixels in order to do some software operation on them, then there is no fast way. The best you can get is glReadPixels with parameters carefully chosen to match the display mode (being careul to not fall into the trap of using e.g GL_RGB because you think it will save memory - all that it will do is cause an even slower format conversion in the driver), but either way you're going to get a huge pipeline stall.

    The exception to this is if you don't need the data immediately following the read-back. In desktop GL you can do an asynchronous readback to a pixel buffer object (PBO) but this facility doesn't seem to be available in ES.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •