From c0be3aae6cfe1e8a51ed21e6fa10c5a51a216c36 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 22 Sep 2016 03:47:55 -0400 Subject: egl: Implement EGL_KHR_context_flush_control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle Reviewed-by: Emil Velikov Signed-off-by: Adam Jackson --- src/egl/main/eglapi.c | 1 + src/egl/main/eglcontext.c | 10 ++++++++++ src/egl/main/eglcontext.h | 1 + src/egl/main/egldisplay.h | 1 + 4 files changed, 13 insertions(+) (limited to 'src/egl/main') diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 215332f99cb..76dabba2eb5 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -494,6 +494,7 @@ _eglCreateExtensionsString(_EGLDisplay *dpy) _EGL_CHECK_EXTENSION(KHR_cl_event2); _EGL_CHECK_EXTENSION(KHR_config_attribs); + _EGL_CHECK_EXTENSION(KHR_context_flush_control); _EGL_CHECK_EXTENSION(KHR_create_context); _EGL_CHECK_EXTENSION(KHR_create_context_no_error); _EGL_CHECK_EXTENSION(KHR_fence_sync); diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c index 8c64f9ab82e..18c1bc59acc 100644 --- a/src/egl/main/eglcontext.c +++ b/src/egl/main/eglcontext.c @@ -386,6 +386,15 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy, break; } + case EGL_CONTEXT_RELEASE_BEHAVIOR_KHR: + if (val == EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR || + val == EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR) { + ctx->ReleaseBehavior = val; + } else { + err = EGL_BAD_ATTRIBUTE; + } + break; + default: err = EGL_BAD_ATTRIBUTE; break; @@ -588,6 +597,7 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf, ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR; ctx->ResetNotificationStrategy = EGL_NO_RESET_NOTIFICATION_KHR; ctx->ContextPriority = EGL_CONTEXT_PRIORITY_MEDIUM_IMG; + ctx->ReleaseBehavior = EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR; err = _eglParseContextAttribList(ctx, dpy, attrib_list); if (err == EGL_SUCCESS && ctx->Config) { diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h index a7523683136..8d97ef9eab9 100644 --- a/src/egl/main/eglcontext.h +++ b/src/egl/main/eglcontext.h @@ -64,6 +64,7 @@ struct _egl_context EGLint ResetNotificationStrategy; EGLint ContextPriority; EGLBoolean NoError; + EGLint ReleaseBehavior; /* The real render buffer when a window surface is bound */ EGLint WindowRenderBuffer; diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 952bfe53f00..981cbf4ca06 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -112,6 +112,7 @@ struct _egl_extensions EGLBoolean KHR_cl_event2; EGLBoolean KHR_config_attribs; + EGLBoolean KHR_context_flush_control; EGLBoolean KHR_create_context; EGLBoolean KHR_fence_sync; EGLBoolean KHR_get_all_proc_addresses; -- cgit v1.2.3