From 2b2c5c4f5cb4620044eeaa7cc308e696209c7046 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 15 Aug 2010 17:09:48 +0800 Subject: egl: Add support for EGL_KHR_fence_sync. Individual drivers still need to support and enable the extension. --- src/egl/main/eglsync.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/egl/main/eglsync.c') diff --git a/src/egl/main/eglsync.c b/src/egl/main/eglsync.c index 3f51e89acd..b6c62d0087 100644 --- a/src/egl/main/eglsync.c +++ b/src/egl/main/eglsync.c @@ -46,7 +46,8 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type, { EGLint err; - if (!(type == EGL_SYNC_REUSABLE_KHR && dpy->Extensions.KHR_reusable_sync)) + if (!(type == EGL_SYNC_REUSABLE_KHR && dpy->Extensions.KHR_reusable_sync) && + !(type == EGL_SYNC_FENCE_KHR && dpy->Extensions.KHR_fence_sync)) return _eglError(EGL_BAD_ATTRIBUTE, "eglCreateSyncKHR"); memset(sync, 0, sizeof(*sync)); @@ -55,6 +56,7 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type, sync->Type = type; sync->SyncStatus = EGL_UNSIGNALED_KHR; + sync->SyncCondition = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR; err = _eglParseSyncAttribList(sync, attrib_list); if (err != EGL_SUCCESS) @@ -109,6 +111,11 @@ _eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, case EGL_SYNC_STATUS_KHR: *value = sync->SyncStatus; break; + case EGL_SYNC_CONDITION_KHR: + if (sync->Type != EGL_SYNC_FENCE_KHR) + return _eglError(EGL_BAD_ATTRIBUTE, "eglGetSyncAttribKHR"); + *value = sync->SyncCondition; + break; default: return _eglError(EGL_BAD_ATTRIBUTE, "eglGetSyncAttribKHR"); break; -- cgit v1.2.3