瀏覽代碼

libobs-opengl: Specify display attributes

This is functionally a no-op, but works around a driver bug that
prevents use of eglQueryDisplayAttribEXT. This makes us more likely to
not trigger the driver bug and that gs_enum_adapters works correctly.
Kurt Kartaltepe 1 年之前
父節點
當前提交
d2e50c8c38
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 3 1
      libobs-opengl/gl-wayland-egl.c
  2. 2 1
      libobs-opengl/gl-x11-egl.c

+ 3 - 1
libobs-opengl/gl-wayland-egl.c

@@ -190,7 +190,9 @@ static struct gl_platform *gl_wayland_egl_platform_create(gs_device_t *device,
 
 	device->plat = plat;
 
-	plat->display = eglGetDisplay(plat->wl_display);
+	const EGLAttrib plat_attribs[] = {EGL_NONE};
+	plat->display = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT,
+					      plat->wl_display, plat_attribs);
 	if (plat->display == EGL_NO_DISPLAY) {
 		blog(LOG_ERROR, "eglGetDisplay failed");
 		goto fail_display_init;

+ 2 - 1
libobs-opengl/gl-x11-egl.c

@@ -155,8 +155,9 @@ static EGLDisplay get_egl_display(struct gl_platform *plat)
 							  : NULL);
 
 	if (eglGetPlatformDisplayEXT) {
+		const EGLint plat_attribs[] = {EGL_NONE};
 		edisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_X11_EXT,
-						    display, NULL);
+						    display, plat_attribs);
 		if (EGL_NO_DISPLAY == edisplay)
 			blog(LOG_ERROR, "Failed to get EGL/X11 display");
 	}