OpenGL syncrhonization on iMX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OpenGL syncrhonization on iMX6

Jump to solution
855 Views
anthonypellerin
Contributor I

Hi,

We have some questions regarding OpenGL synchronization.

 

eglSwapBuffers() is an asynchronous function. You call it, and the function return immediately, without any guarantee that the operation are done (or even began).

 

For a specific use case, we need to wait until all operation are done and the result is visible on screen, before doing anything else.

It would look like:

eglSwapBuffers();

Wait until all operation are done;

Resume normal operation ...

At first we thought glfinish() would do the trick, but it doesn't seem to be the case.

 

A bit of context:

This is on WEC7, imX6 DL.

lib Vivante version is around 4.6.

DDRAW overlay are using double buffering.

 

We would need a function waiting until flip() was called on the DDRAW overlays.

Does such a function exist ?

If not, is there any way to work around the problem ?

What is glfinish exact behavior ?

Thanks

Labels (2)
0 Kudos
1 Solution
631 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Anthony,

glFlush ensures that previous OpenGL commands must complete in infinite time, glFinish does not return until all effects from previously issued commands are fully realized. This means that the execution of your program waits here until every last pixel is drawn and OpenGL has nothing more to do. If you render directly to the front buffer, glFinish is the call to make before using the operating system calls to take screenshots. It is far less useful for double buffering, because you don't see the changes you forced to complete.

So if you use double buffering, you probably won't need neither glFlush nor glFinish. SwapBuffers implicitly directs the OpenGL calls to the correct buffer, there is no need to call glFlush firts

Hope it helps

View solution in original post

0 Kudos
1 Reply
632 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Anthony,

glFlush ensures that previous OpenGL commands must complete in infinite time, glFinish does not return until all effects from previously issued commands are fully realized. This means that the execution of your program waits here until every last pixel is drawn and OpenGL has nothing more to do. If you render directly to the front buffer, glFinish is the call to make before using the operating system calls to take screenshots. It is far less useful for double buffering, because you don't see the changes you forced to complete.

So if you use double buffering, you probably won't need neither glFlush nor glFinish. SwapBuffers implicitly directs the OpenGL calls to the correct buffer, there is no need to call glFlush firts

Hope it helps

0 Kudos