[Mesa-dev] [PATCH 1/4] egl: Add EGL_KHR_create_context_no_error support

Grigori Goronzy greg at chown.ath.cx
Wed Jul 12 12:53:29 UTC 2017


On 2017-07-12 12:33, Eric Engestrom wrote:
>> +      case EGL_CONTEXT_OPENGL_NO_ERROR_KHR:
>> +         if (dpy->Version < 14) {
>> +            err = EGL_BAD_ATTRIBUTE;
>> +            break;
>> +         }
>> +
>> +         /* The KHR_no_error spec only applies against OpenGL 2.0+ 
>> and
>> +          * OpenGL ES 2.0+
>> +          */
>> +         if ((api != EGL_OPENGL_API && api != EGL_OPENGL_ES_API) ||
>> +             ctx->ClientMajorVersion < 2) {
>> +            err = EGL_BAD_ATTRIBUTE;
>> +            break;
>> +         }
>> +
>> +         /* The EGL_KHR_create_context_no_error spec says:
>> +          *
>> +          *    "BAD_MATCH is generated if the 
>> EGL_CONTEXT_OPENGL_NO_ERROR_KHR is TRUE at
>> +          *    the same time as a debug or robustness context is 
>> specified."
>> +          */
>> +         if (ctx->Flags & EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR ||
>> +             ctx->Flags & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR) {
>> +            err = EGL_BAD_MATCH;
>> +            break;
>> +         }
>> +
>> +         /* Canonicalize value to EGL_TRUE/EGL_FALSE definitions */
>> +         ctx->NoError = !!val;
> 
> Do we need NoError?
> Wouldn't adding __DRI_CTX_FLAG_NO_ERROR to Flags be enough?
> 

The "Flags" field is for EGL context flags. There is no EGL context flag 
for KHR_no_error. It looks like an oversight in the 
KHR_create_context_no_error specification, but we can't fix it.

Grigori

> Cheers,
>   Eric
> 
>> +         break;
>> +
>>        default:
>>           err = EGL_BAD_ATTRIBUTE;
>>           break;
>> diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h
>> index f2fe806..0667622 100644
>> --- a/src/egl/main/eglcontext.h
>> +++ b/src/egl/main/eglcontext.h
>> @@ -62,6 +62,7 @@ struct _egl_context
>>     EGLint Flags;
>>     EGLint Profile;
>>     EGLint ResetNotificationStrategy;
>> +   EGLBoolean NoError;
>> 
>>     /* 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 a13ff5b..3d5a445 100644
>> --- a/src/egl/main/egldisplay.h
>> +++ b/src/egl/main/egldisplay.h
>> @@ -122,6 +122,7 @@ struct _egl_extensions
>>     EGLBoolean KHR_reusable_sync;
>>     EGLBoolean KHR_surfaceless_context;
>>     EGLBoolean KHR_wait_sync;
>> +   EGLBoolean KHR_create_context_no_error;
>> 
>>     EGLBoolean MESA_drm_image;
>>     EGLBoolean MESA_image_dma_buf_export;
>> --
>> 2.7.4
>> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list