Skip to content

Commit

Permalink
egl: Support ANGLE EGL platform on winit X11
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ids1024 committed Jul 19, 2023
1 parent c1da790 commit 2f00e12
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/backend/egl/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ impl EGLNativeDisplay for Arc<WinitWindow> {
egl_platform!(PLATFORM_X11_KHR, display, &["EGL_KHR_platform_x11"]),
// see: https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_platform_x11.txt
egl_platform!(PLATFORM_X11_EXT, display, &["EGL_EXT_platform_x11"]),
// see: https://raw.githubusercontent.com/google/angle/main/extensions/EGL_ANGLE_platform_angle.txt
egl_platform!(
PLATFORM_ANGLE_ANGLE,
display,
&["EGL_ANGLE_platform_angle", "EGL_ANGLE_platform_angle_vulkan"],
vec![
ffi::egl::PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE,
ffi::egl::PLATFORM_X11_EXT as _,
ffi::egl::PLATFORM_ANGLE_TYPE_ANGLE,
ffi::egl::PLATFORM_ANGLE_TYPE_VULKAN_ANGLE,
ffi::egl::NONE as ffi::EGLint
]
),
]
} else {
unreachable!("No backends for winit other then Wayland and X11 are supported")
Expand Down

0 comments on commit 2f00e12

Please sign in to comment.