egl-wayland icon indicating copy to clipboard operation
egl-wayland copied to clipboard

EGL_MAX_SWAP_INTERVAL reported as zero despite apparent vsync support

Open tim-rex opened this issue 8 months ago • 1 comments

I'm finding that both EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL are both reporting 0

The EGL specification indicates the default swap interval should be 1 (vsync) and in my testing it appears that vsync is in effect.

I am able to succesfully disable vsync via eglSwapInterval(0) and more interestingly I am able to reenable vsync via eglSwapInterval(1) despite the reported EGL_MAX_SWAP_INTERVAL

Anecdotally, it would seem the reported maximum swap interval is incorrectly reported as 0 rather than 1

The following eglConfig attributes are being passed if that is relevant

		static const EGLint configAttribs[] = {
			EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
			EGL_BLUE_SIZE, 8,
			EGL_GREEN_SIZE, 8,
			EGL_RED_SIZE, 8,
			EGL_ALPHA_SIZE, 8,
			EGL_DEPTH_SIZE, 8,
			EGL_CONFORMANT, EGL_OPENGL_BIT,
			EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
			EGL_NONE
		};

I'm using eglGetPlatformDisplayEXT with EGL_PLATFORM_WAYLAND_KHR

Fedora Linux 39 (Workstation Edition) Linux 6.5.11-300.fc39.x86_64 GNOME Version 45.1 nVidia Driver version 535.129.03

Output of eglinfo attached eglinfo.txt

Incidentally, eglinfo is seg faulting.. I'll raise a separate issue

tim-rex avatar Nov 14 '23 04:11 tim-rex

I think I know what the problem is here.

In wlEglGetConfigAttribHook and wlEglChooseConfigHook, it tweaks driver's attribute list to add EGL_WINDOW_BIT, but it needs to also tweak EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL the same way.

kbrenneman avatar Nov 14 '23 14:11 kbrenneman