EGL context creation fails when EGL_KHR_create_context_no_error is mentioned for OpenGL ES 1.1.
System information
- OS:
NAME="Arch Linux"
- GPU:
0b:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] [1002:731f] (rev c1)
- Kernel version:
5.11.10-arch1-1
- Mesa version:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.0.1
- Xserver version (if applicable):
X.Org X Server 1.20.10
- Desktop manager and compositor:
GNOME Shell (Wayland)
Describe the issue
eglCreateContext
fails with EGL_BAD_ATTRIBUTE
when EGL_CONTEXT_OPENGL_NO_ERROR_KHR
is part of the attrib list when creating a context with version 1.1.
The EGL_KHR_create_context_no_error
extension is reported as available through eglQueryString
.
The context creation even fails when EGL_CONTEXT_OPENGL_NO_ERROR_KHR
is set to EGL_FALSE
.
The context creation succeeds when the OpenGL ES client version is set to a version above 1.1,
e.g. 2.0 or 3.2 via the EGL_CONTEXT_MAJOR_VERSION_KHR
and EGL_CONTEXT_MINOR_VERSION_KHR
attributes.
This is due to the context creation intentionally failing for API versions below 2: https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/src/egl/main/eglcontext.c#L334
Reading the specification though I was not able to find a GLES version restriction: https://github.com/KhronosGroup/EGL-Registry/blob/master/extensions/KHR/EGL_KHR_create_context_no_error.txt
This is related to an issue found in ANGLE, which fails to create GLES 1.0 EGL contexts on mesa. https://bugs.chromium.org/p/angleproject/issues/detail?id=5809
Log
libEGL debug: bad context attribute 0x31b3
libEGL debug: EGL user error 0x3004 (EGL_BAD_ATTRIBUTE) in eglCreateContext
Minimal Example
A minimal example reproducing this issue can be found here: https://gitlab.freedesktop.org/lubosz/egl-no-error-example/-/blob/master/egl_no_error.c