summaryrefslogtreecommitdiff
path: root/src/egl/main
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-08-15 17:09:48 +0800
committerChia-I Wu <olv@lunarg.com>2010-08-17 00:06:19 +0800
commit2b2c5c4f5cb4620044eeaa7cc308e696209c7046 (patch)
tree73491cce8ec3d2e3fcbd144a1f3560598cb38506 /src/egl/main
parent4b2495661f3a5ac8ed07b68c5d5bf90adee2c37d (diff)
egl: Add support for EGL_KHR_fence_sync.
Individual drivers still need to support and enable the extension.
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/egldisplay.h1
-rw-r--r--src/egl/main/eglmisc.c1
-rw-r--r--src/egl/main/eglsync.c9
-rw-r--r--src/egl/main/eglsync.h1
4 files changed, 11 insertions, 1 deletions
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index a5c1453067..97c9d196ec 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -64,6 +64,7 @@ struct _egl_extensions
EGLBoolean KHR_gl_renderbuffer_image;
EGLBoolean KHR_reusable_sync;
+ EGLBoolean KHR_fence_sync;
EGLBoolean KHR_surfaceless_gles1;
EGLBoolean KHR_surfaceless_gles2;
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index 2ef6ba59e3..b10783bcb9 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -98,6 +98,7 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(KHR_gl_renderbuffer_image);
_EGL_CHECK_EXTENSION(KHR_reusable_sync);
+ _EGL_CHECK_EXTENSION(KHR_fence_sync);
_EGL_CHECK_EXTENSION(KHR_surfaceless_gles1);
_EGL_CHECK_EXTENSION(KHR_surfaceless_gles2);
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;
diff --git a/src/egl/main/eglsync.h b/src/egl/main/eglsync.h
index a0134784aa..25c467175e 100644
--- a/src/egl/main/eglsync.h
+++ b/src/egl/main/eglsync.h
@@ -19,6 +19,7 @@ struct _egl_sync
EGLenum Type;
EGLenum SyncStatus;
+ EGLenum SyncCondition;
};