[Mesa-dev] [PATCH] egl: fix check for KHR_no_error vs debug/robustness

Grigori Goronzy greg at chown.ath.cx
Wed Jul 26 07:59:27 UTC 2017


On 2017-07-19 23:51, Grigori Goronzy wrote:
> The check is too aggressive and might also fail if context flags
> appear after the no-error attribute in the context attribute list.
> 
> Delay the check to after attribute parsing to fix this.
> ---
> This was found by the piglit test I just sent to the piglit ML. I 
> promise,
> next time I'll write tests before writing any code that touches public
> interfaces. :)
> 

Ping.

I'd especially like to get this into Mesa 7.2. Like noted earlier, this 
patch can be tested with the new piglit test I've sent.

Grigori

>  src/egl/main/eglcontext.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
> index 1a8e9bd..1b03160 100644
> --- a/src/egl/main/eglcontext.c
> +++ b/src/egl/main/eglcontext.c
> @@ -328,17 +328,6 @@ _eglParseContextAttribList(_EGLContext *ctx,
> _EGLDisplay *dpy,
>              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;
>           break;
> @@ -489,6 +478,16 @@ _eglParseContextAttribList(_EGLContext *ctx,
> _EGLDisplay *dpy,
>        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->NoError && (ctx->Flags & EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 
> ||
> +                        ctx->Flags &
> EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR)) {
> +      err = EGL_BAD_MATCH;
> +   }
> +
>     if ((ctx->Flags & ~(EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
>                        | EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
>                        | EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR)) != 
> 0) {


More information about the mesa-dev mailing list