OpenGL syncrhonization on iMX6

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

OpenGL syncrhonization on iMX6

跳至解决方案
1,116 次查看
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

标签 (2)
0 项奖励
回复
1 解答
892 次查看
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 项奖励
回复
1 回复
893 次查看
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 项奖励
回复