Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b27dbcc3 authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter
Browse files

Flag invalid robust access attribute

The vendor driver may support EGL 1.5 while only EGL 1.4 is presented
to applications. According to the specification,
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY is not supported with
GLES until EGL 1.5. Because the vendor driver may be a different
version than what's presented to applications, throw an error on the invalid
attribute rather than depend on the vendor driver to flag the error.
bug: 111083885
Test: dEQP-EGL.functional.robustness.negative_context.invalid_notification_strategy_enum

Change-Id: I22702f74700d834667bed92939fcabab5f0726e8
parent 2efcc95e
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -954,6 +954,22 @@ EGLContext eglCreateContextImpl(EGLDisplay dpy, EGLConfig config,
            egl_context_t* const c = get_context(share_list);
            share_list = c->context;
        }
        // b/111083885 - If we are presenting EGL 1.4 interface to apps
        // error out on robust access attributes that are invalid
        // in EGL 1.4 as the driver may be fine with them but dEQP expects
        // tests to fail according to spec.
        if (attrib_list && (cnx->driverVersion < EGL_MAKE_VERSION(1, 5, 0))) {
            const EGLint* attrib_ptr = attrib_list;
            while (*attrib_ptr != EGL_NONE) {
                GLint attr = *attrib_ptr++;
                GLint value = *attrib_ptr++;
                if (attr == EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR) {
                    // We are GL ES context with EGL 1.4, this is an invalid
                    // attribute
                    return setError(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);
                }
            };
        }
        EGLContext context = cnx->egl.eglCreateContext(
                dp->disp.dpy, config, share_list, attrib_list);
        if (context != EGL_NO_CONTEXT) {