Results 1 to 6 of 6

Thread: Peformance for using Frame buffers and glReadPixels

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Peformance for using Frame buffers and glReadPixels

    Hi,

    I am using Open GLES 1.1 and I have to use glReadPixels to generate output data at 1024x1024. As glReadPixels is slow, I am looking into using the GL_OES_framebuffer_object extension and render textures into frame buffer objects first before glReadPixels. Can this help improve the performance for glReadPixels ?

    Thanks.

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Peformance for using Frame buffers and glReadPixels

    I don't see how.

  3. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Re: Peformance for using Frame buffers and glReadPixels

    Thus, is there any other way that i can obtain the output data besides glReadPixels and not using pixmap?

  4. #4
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Peformance for using Frame buffers and glReadPixels

    You can't make copying pixels itself faster that way, but if you are rendering multiple frames then you can avoid stalling the CPU and GPU when using glReadPixels. As GPUs operate in parallel to the CPU, if you do a few draw calls and then call glReadPixels immediately afterwards, chances are that the GPU hasn't finished processing those draw calls. So glReadPixels will have to wait, letting the CPU idle. Then once the GPU has finished rendering and the driver can start copying pixels, the GPU will be idle since no further draw calls have been queued.

    If you render to a texture/renderbuffer and then delay calling glReadPixels for a "safe" amount of time during which you submit draw calls for further frames, you can avoid these stalls.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  5. #5
    Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Re: Peformance for using Frame buffers and glReadPixels

    Thanks!
    Can I clarify further on this please.
    Say I need 15 frames per second, but I only have 1 texture as I just need to display the same texture 15 times but making different gl operations on it. Thus I will render my first texture for the first frame to a frame buffer, make a few gl operations and call gldraw, then do the same for the next few frames. Subsequently I only start to render my first frame from the buffer and call glreadpixels for the first frame, so as to delay the time?

    If I do glflush everytime after gldraw, does this cause the glreadpixels to slow down too?

    Thanks again.

  6. #6

    Re: Peformance for using Frame buffers and glReadPixels

    The glReadPixels function has an implicit finish/fence since it needs to ensure rendering is completed before coping things back to the user pointer. So avoiding unnecessary flushes/finishes is always good.

Similar Threads

  1. Frame Rate in ES???
    By qasim1981 in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 11-17-2004, 01:02 PM
  2. frame updating
    By JazzD in forum OpenGL ES general technical discussions
    Replies: 4
    Last Post: 10-20-2004, 08:50 PM

Posting Permissions

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