AnsweredAssumed Answered

Rendering to an surfaceless OpenGL ES context does not work correctly.

Question asked by Milosz Lazurek on Jan 22, 2018
Latest reply on Feb 14, 2018 by Bio_TICFSL
Branched to a new discussion

I have observed rendering problem when running the attached OpenGL ES program that uses two shared contexts where one context is associated with a window surface and another context is a offscreen surface-less context, rendering into FBO which is used by the window context.

It seems that the offscreen context does not render correctly into the FBO everytime and hangs after rendering one frame. The commands issued in this OpenGL ES context do not have any effect, and the FBO texture is not updated wit a new context.

The problem is observed on Freescale Yocto (fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga) i.MX6Q SabreSD and Sabre AI but NOT on i.MXQP, i.MX6DL or i.MX6SoloX.


If a workaround as below is added into the program to read back the off screen, the rendering works correctly. Somehow it forces to execute and flush command buffers on the surfacelless context, but enforces a performance penalty as this call blocks until finished.


glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &data);


Please find the attached OpenGL ES program compiled using the following

$CXX -O2 -DLINUX -DEGL_API_FB -D_FSLVIV ml_matrixmath.cpp

ml_vectormath.cpp resource.cpp main.cpp -

lpthread -lm -ldl -lGLESv2 -lEGL


Please let us know what is the problem and if there is any patch or other workaround to resolve the problemwithout doing glReadPixel that reduces the performance.