This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-J721E: OpenGL rendering

Part Number: PROCESSOR-SDK-J721E

Hi,

I'm currently trying to adapt an OpenGL renderer working on a desktop platform to TDA4.

Since I'm using the TDA4 configured with the display on the R5 processor, I have understood that I need to use an OpenVX DisplayNode to do the actual display.

I have tried to create a simple application runningOpenGL code to try the screen output using as a reference the code of appEglWindow located in vision_apps/utils/opengl/src/a72/app_gl_egl_utils_linux.c.

So my approach is to:

1. Render all objects into an offscreen framebuffer using the same OpenGL code as we have on the standard linux desktop implementation.

2. Extract this framebuffer and create an OpenVX vx_image with its content.

3. Feed the OpenVX image created to an OpenVX display node to perform the actual display.

I'm currently running into EGL and OpenGL errors during runtime:

  • OpenGL error 1286 (GL_INVALID_FRAMEBUFFER_OPERATION) after the call to glClear
  • EGL error 12301 (EGL_BAD_SURFACE) after the call to eglSwapBuffers

I also have further questions concerning my approach:

  • Could you tell me if my approach is correct / feasible ?
  • Would you propose another approach to achieve this ? Is there another approach that is more optimized to interact between OpenGL and the actual DisplayNode without having to extract the whole framebuffer ?
  • If this approach is correct, could you provide me with some support / examples on how to correctly create the OpenGL framebuffer with EGL on TDA4 and subsequently convert it to a vx_image ?
  • Do you have some documentation on the TDA4 implementation and usage of EGL / OpenGLES ?
  • I have seen in app_egl_utils that we are using the EGL platform extension "EGL_MESA_platform_surfaceless" on which we are not able to draw pixels to. Should I create a framebuffer manually when this extension is activated ?

CF: I'm using RTOS SDK j721e v8.6.

  • Hello,

    I'm currently trying to adapt an OpenGL renderer working on a desktop platform to TDA4.

    So you have working OpenGL code, or OpenGLES code? The code will need to be in OpenGLES to run on our TDA4 platforms.

    So my approach is to:

    1. Render all objects into an offscreen framebuffer using the same OpenGL code as we have on the standard linux desktop implementation.

    2. Extract this framebuffer and create an OpenVX vx_image with its content.

    3. Feed the OpenVX image created to an OpenVX display node to perform the actual display.

    This is the general approach. You can see in our demos (srv) that we allocate buffers that are dma-buf allocated, and we use these for the input/output of the GPU application. In order to save memory bandwidth, we are using a similar approach. We are able to use the dma-buf buffers to perform "zero-copy" transfers with the OpenVX graph.

    I'm currently running into EGL and OpenGL errors during runtime:

    • OpenGL error 1286 (GL_INVALID_FRAMEBUFFER_OPERATION) after the call to glClear
    • EGL error 12301 (EGL_BAD_SURFACE) after the call to eglSwapBuffers

    Can you share how you initialized your code?

    Perhaps I can provide a reference for just the OpenGL code, and then you can try to integrate that with your OpenVX graph.

    Regards,

    Erick