Skip to content

Commit 2f00e12

Browse files
committed
egl: Support ANGLE EGL platform on winit X11
Unlike Wayland, X11 works on the OpenGL backend of ANGLE. But then `GL_OES_EGL_image_external` isn't available. So we need to use Vulkan here too.
1 parent c1da790 commit 2f00e12

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/backend/egl/native.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,19 @@ impl EGLNativeDisplay for Arc<WinitWindow> {
195195
egl_platform!(PLATFORM_X11_KHR, display, &["EGL_KHR_platform_x11"]),
196196
// see: https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_platform_x11.txt
197197
egl_platform!(PLATFORM_X11_EXT, display, &["EGL_EXT_platform_x11"]),
198+
// see: https://raw.githubusercontent.com/google/angle/main/extensions/EGL_ANGLE_platform_angle.txt
199+
egl_platform!(
200+
PLATFORM_ANGLE_ANGLE,
201+
display,
202+
&["EGL_ANGLE_platform_angle", "EGL_ANGLE_platform_angle_vulkan"],
203+
vec![
204+
ffi::egl::PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE,
205+
ffi::egl::PLATFORM_X11_EXT as _,
206+
ffi::egl::PLATFORM_ANGLE_TYPE_ANGLE,
207+
ffi::egl::PLATFORM_ANGLE_TYPE_VULKAN_ANGLE,
208+
ffi::egl::NONE as ffi::EGLint
209+
]
210+
),
198211
]
199212
} else {
200213
unreachable!("No backends for winit other then Wayland and X11 are supported")

0 commit comments

Comments
 (0)