DeltaPorts icon indicating copy to clipboard operation
DeltaPorts copied to clipboard

Fix EGL Window creation and prevent GLFW-Wayland from SEGFAULTING

Open FrostKiwi opened this issue 4 years ago • 4 comments

These are fixes that I needed to apply in order for glfwCreateWindow() to stop SEGFAULTING, with the main culprit being EXT_image_dma_buf usage, despite not being supported. The patches allow window creation on sway, with Mesa 18.3.2 and newer. However, due to EXT_KHR not being properly used, the window remains blank with Mesa 18.3.2, even though a context is successfully created. Proper EXT_KHR extension use was fixed at some point and with Mesa 20.2.0-devel (git-412e29c277) at the latest, window and context creation works without issue.

All patch files were diffed against Mesa 20.2.0-devel (git-412e29c277).

FrostKiwi avatar May 14 '20 00:05 FrostKiwi

@FrostKiwi sorry for not taking care of this PR earlier, but would you still have a working DragonFly setup running wayland/Sway ? We would like to test the current state of wayland before trying to upgrade it to the version of the FreeBSD ports (see the draft in https://github.com/DragonFlyBSD/DeltaPorts/pull/1293)

daftaupe avatar Nov 03 '22 11:11 daftaupe

@FrostKiwi sorry for not taking care of this PR earlier, but would you still have a working DragonFly setup running wayland/Sway ? We would like to test the current state of wayland before trying to upgrade it to the version of the FreeBSD ports (see the draft in #1293)

Sure. I actually switched to FreeBSD, but I'll throw DragonFlyBSD again on a machine an check the state of Window creation.

FrostKiwi avatar Nov 04 '22 01:11 FrostKiwi

@FrostKiwi sorry for not taking care of this PR earlier, but would you still have a working DragonFly setup running wayland/Sway ? We would like to test the current state of wayland before trying to upgrade it to the version of the FreeBSD ports (see the draft in #1293)

Sure. I actually switched to FreeBSD, but I'll throw DragonFlyBSD again on a machine an check the state of Window creation.

If you could actually describe the steps maybe we can do it ourselves. Let me know :)

tuxillo avatar Jul 28 '23 16:07 tuxillo

@FrostKiwi sorry for not taking care of this PR earlier, but would you still have a working DragonFly setup running wayland/Sway ? We would like to test the current state of wayland before trying to upgrade it to the version of the FreeBSD ports (see the draft in #1293)

Sure. I actually switched to FreeBSD, but I'll throw DragonFlyBSD again on a machine an check the state of Window creation.

If you could actually describe the steps maybe we can do it ourselves. Let me know :)

Ohh sry. Kind of stuck with other tasks to reinstall a whole OS to fix something that might not be there anymore.

The crux of the issue was Wayland window creation segfaulting under specific situations, because DragonFlyBSD did not support EXT_image_dma_buf, which caused a black window or crash (depending the Mesa version) to appear under the specific combination of a Wayland compositor running a wayland window created via GLFW.

Unless I misremember something, to confirm this still being an issue would be to create a Window using GLFW in Wayland mode under swaywm as the compositor. GLFW usually comes default in X11 mode and has to be recompiled with GLFW_USE_WAYLAND set to true. Then window creation failed on DragonFlyBSD, which was traced to EXT_image_dma_buf missing with the help from the Mesa dev's IRC channel.

FrostKiwi avatar Aug 02 '23 07:08 FrostKiwi