Hi,
I am trying to improve NvEglRenderer to synchronize rendering with camera capture.
I cannot understand why NvEglRenderer calls eglCreateSyncKHR before eglSwapBuffers and eglClientWaitSyncKHR after.
I see some other examples:
http://mobile3dgraphics.blogspot.com/2013/01/consumerproducer-approach-for.html
One thread calls:
gl<Various>
eglCreateSyncKHR
eglSwapBuffers
Another thread calls:
eglClientWaitSyncKHR
eglGetSyncAttribKHR
eglDestroySyncKHR
This makes sense - one thread creates sync and passes to another thread, which waits on it.
The same here:
https://android.googlesource.com/platform/frameworks/native/+/e6288e2/opengl/libs/EGL/eglApi.cpp
threadLoop:
eglClientWaitSyncKHR
eglDestroySyncKHR
eglSwapBuffersWithDamageKHR:
eglCreateSyncKHR
FrameCompletionThread::queueSync(sync);
eglSwapBuffers
Again, one thread creates sync and passes to another thread, which waits on it.
But NvEglRenderer never passes egl_sync to another thread. These are called all in one thread:
gl<Various>
eglCreateSyncKHR
eglSwapBuffers
eglClientWaitSyncKHR
eglDestroySyncKHR
This makes no sense. eglSwapBuffers already waits for display flip, right?
Why do you need second wait in eglClientWaitSyncKHR?
Thank you