[Mesa-dev] [PATCH 07/10] egl: Implement front-end support for EGL_EXT_create_context_robustness

Kenneth Graunke kenneth at whitecape.org
Sun Aug 12 15:28:54 PDT 2012


On 08/08/2012 10:57 AM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/egl/main/eglcontext.c |   25 +++++++++++++++++++++++++
>  src/egl/main/egldisplay.h |    2 ++
>  src/egl/main/eglmisc.c    |    2 ++
>  3 files changed, 29 insertions(+), 0 deletions(-)
> 
> diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
> index c9a9948..cb50de7 100644
> --- a/src/egl/main/eglcontext.c
> +++ b/src/egl/main/eglcontext.c
> @@ -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;
> +         }

Yes, it does say that, but it doesn't make sense.  From the same spec:

"This extension allows creating an OpenGL or OpenGL ES context
 supporting robust buffer access behavior and a specified graphics
 reset notification behavior."

If you can't specify a reset notification strategy on desktop GL, then
the extension hasn't done what it set out to do.  I would guess that the
actual intent here is to disallow the token on EGL_OPENVG_API (where the
whole notion is not defined), but allow it for the GL and ES APIs (where
it is well defined).

> +
> +         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;
> diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
> index ba62941..ccb1fbc 100644
> --- a/src/egl/main/egldisplay.h
> +++ b/src/egl/main/egldisplay.h
> @@ -112,6 +112,8 @@ struct _egl_extensions
>     EGLBoolean ANDROID_image_native_buffer;
>  
>     EGLBoolean NV_post_sub_buffer;
> +
> +   EGLBoolean EXT_create_context_robustness;
>  };
>  
>  
> diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
> index 1f7d9a0..b7599d0 100644
> --- a/src/egl/main/eglmisc.c
> +++ b/src/egl/main/eglmisc.c
> @@ -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
>  }



More information about the mesa-dev mailing list