NVIDIA / egl-wayland

The EGLStream-based Wayland external platform
MIT License
293 stars 47 forks source link

Calling wl_egl_window_resize from different thread broken #52

Closed sulix closed 5 months ago

sulix commented 2 years ago

If wl_egl_window_resize() is called from a thread other than the one the window's EGLSurface is Current on, the state of which surface is current on which thread can get messed up.

See: https://github.com/libsdl-org/SDL/pull/4821#issuecomment-943578513

Deferring the resize until eglSwapBuffers does appear to work as a workaround for this.

This breaks a number of games when run under Wayland, particularly:

Both of which will hang on startup.

With SDL using wayland by default now, this will start to affect any of these games which update to the latest SDL version.

sulix commented 2 years ago

Implemented a hacky workaround which defers the resize until SwapBuffers here: https://github.com/NVIDIA/egl-wayland/pull/53