egl: Implement front-end support for EGL_EXT_create_context_robustness
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 19 Jul 2012 22:08:06 +0000 (15:08 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 14 Aug 2012 22:41:03 +0000 (15:41 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/egl/main/eglcontext.c
src/egl/main/egldisplay.h
src/egl/main/eglmisc.c

index c9a994836d29d189fd2baca1be2495062aa1f6ab..cb50de7a9a7f75a784829f9cc40654a3ec0fe366 100644 (file)
@@ -169,6 +169,31 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
          ctx->ResetNotificationStrategy = val;
          break;
 
+      case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:
+         /* The EGL_EXT_create_context_robustness spec says:
+          *
+          *     "[EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT] is only
+          *     meaningful for OpenGL ES contexts, and specifying it for other
+          *     types of contexts will generate an EGL_BAD_ATTRIBUTE error."
+          */
+         if (!dpy->Extensions.EXT_create_context_robustness
+             || api != EGL_OPENGL_ES_API) {
+            err = EGL_BAD_ATTRIBUTE;
+            break;
+         }
+
+         ctx->ResetNotificationStrategy = val;
+         break;
+
+      case EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT:
+         if (!dpy->Extensions.EXT_create_context_robustness) {
+            err = EGL_BAD_ATTRIBUTE;
+            break;
+         }
+
+         ctx->Flags = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
+         break;
+
       default:
          err = EGL_BAD_ATTRIBUTE;
          break;
index ba629411a2d54cbfae6b603aaa4c53c90b141abf..ccb1fbc699258dbefc7b59e745c0c146bbe57ee8 100644 (file)
@@ -112,6 +112,8 @@ struct _egl_extensions
    EGLBoolean ANDROID_image_native_buffer;
 
    EGLBoolean NV_post_sub_buffer;
+
+   EGLBoolean EXT_create_context_robustness;
 };
 
 
index 1f7d9a0e1115c7bf275b0dc7b17f133f2fc54af8..b7599d01794c4f5b0713adca77198faeb783964d 100644 (file)
@@ -115,6 +115,8 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
 
    _EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
 
+   _EGL_CHECK_EXTENSION(EXT_create_context_robustness);
+
    _EGL_CHECK_EXTENSION(NV_post_sub_buffer);
 #undef _EGL_CHECK_EXTENSION
 }