EGL_ANDROID_native_fence_sync#

Supported Hardware#

Series6, Series6XE, Series6XT

Valid APIs#

EGL 1.1

Description#

This extension enables the creation of EGL fence sync objects that are associated with a native synchronization fence object that is referenced using a file descriptor. These EGL fence sync objects have nearly identical semantics to those defined by the KHR_fence_sync extension, except that they have an additional attribute storing the file descriptor referring to the native fence object.

This extension assumes the existence of a native fence synchronization object that behaves similarly to an EGL fence sync object. These native objects must have a signal status like that of an EGLSyncKHR object that indicates whether the fence has ever been signaled. Once signaled the native object’s signal status may not change again.

Note#

Requires EGL 1.1

This extension is written against the wording of the EGL 1.2 Specification.

EGL_KHR_fence_sync is required.

Example#

//===============
// Process A:
//===============
EGLSyncKHR eglSyncKHR = eglCreateSyncKHR(eglDisplay, EGL_SYNC_REUSABLE_KHR, NULL);
EGLint FileDescriptor = eglDupNativeFenceFDANDROID(eglDisplay, eglSyncKHR);
//===============
// Process B:
//===============
EGLint attrs[] = {
  EGL_SYNC_NATIVE_FENCE_FD_ANDROID, FileDescriptor,
  EGL_SYNC_CONDITION_KHR, EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID
  EGL_NONE,
};
EGLSyncKHR eglSyncKHR = eglCreateSyncKHR(eglDisplay, EGL_SYNC_NATIVE_FENCE_ANDROID, attrs);
eglClientWaitSyncKHR(eglDisplay, eglSyncKHR, 0, EGL_FOREVER_KHR);