glReadPixels alternative?

This topic contains 2 replies, has 2 voices, and was last updated by  enrico 6 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30684

    enrico
    Member

    Hi,

    i’ve developed an application (for omap3530) that uses texture streaming extension to “upload” video frames (720×625 UYVY) to sgx, applies a fragment shader and renders to a FBO. With this setup it can handle the incoming 25 fps video stream with a rendering time of about 1ms.

    As others have pointed out in this forum, the problem is when trying to read back processed video frames with glReadPixels. With my setup it gets about 150ms for every glReadPixels call.

    Is there an  alternative way to get data “out” that doesn’t kill performance?

    Thanks

    #35223

    Joe Davis
    Member

    Hi Enrico,

    There isn’t a generic alternative to glReadPixels(). There may be a platform/OS specific way of reading databack from the GPU more optimally. An example of this is when an OS allows an application to retrieve a CPU handle to an EGLImage surface. The application can then have the CPU accessing one EGLImage surface while the GPU writes to another. If it is possible to implement something like this on your target platform, you will also need to implement a locking mechanism to prevent the CPU and GPU accessing the same surface at the same time.

    #35224

    enrico
    Member

    Hi Joe,

    basically what i need will be to:

    – create an eglImage with eglCreateImageKHR using a native pixmap or texture (EGL_NATIVE_PIXMAP_KHR or EGL_GL_TEXTURE_2D_KHR)

    – bind it to a texture (with glEGLImageTargetTexture2D ?)

    – use this texture as a color attachment in a FBO

    – read from the native pixmap pointer when the gpu is not rendering.

    Is this correct?

    With TI OMAP on linux the NativePixmap should be supported and the EGL image extensions are present so every bit should be there.

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.