Problem
The GLES backend (--cfg gles) fails on Linux with older Mesa drivers (tested: 21.2.6 / Intel UHD) with BadNativeWindow or BadAlloc.
Three issues compound:
-
Surfaceless platform preferred over windowed — EGL_MESA_platform_surfaceless is selected before native X11/Wayland platforms. Surfaceless cannot
create window surfaces.
-
XCB window ID passed as pointer — The Rwh::Xcb branch passes &mut temp_xcb_handle (pointer to u32) but eglCreateWindowSurface expects the raw
XID as NativeWindowType.
-
EGL_SINGLE_BUFFER rejected — Some Mesa drivers reject EGL_SINGLE_BUFFER with BadAlloc on window surfaces. The code already documents this
risk.
Environment
- Mesa 21.2.6 (Debian Bullseye)
- Intel UHD Graphics (CometLake-U GT2)
- EGL 1.5, Vulkan 1.2 only
- Wayland session with XWayland
This issue was investigated and diagnosed with Claude Code (Opus 4.6).
Problem
The GLES backend (
--cfg gles) fails on Linux with older Mesa drivers (tested: 21.2.6 / Intel UHD) withBadNativeWindoworBadAlloc.Three issues compound:
Surfaceless platform preferred over windowed —
EGL_MESA_platform_surfacelessis selected before native X11/Wayland platforms. Surfaceless cannotcreate window surfaces.
XCB window ID passed as pointer — The
Rwh::Xcbbranch passes&mut temp_xcb_handle(pointer to u32) buteglCreateWindowSurfaceexpects the rawXID as
NativeWindowType.EGL_SINGLE_BUFFERrejected — Some Mesa drivers rejectEGL_SINGLE_BUFFERwithBadAllocon window surfaces. The code already documents thisrisk.
Environment
This issue was investigated and diagnosed with Claude Code (Opus 4.6).