Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egl/display: workaround gbm platforms on EGL 1.4 #1716

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
- Added `NotCurrentContext::make_current_surfaceless(self)` and
`PossiblyCurrentContext::make_current_surfaceless(&self)` in the `Wgl`
implementation to allow the use of surfaceless contexts with WGL.
- Added workaround for EGL drivers reporting `EGL_KHR_platform_gbm` with EGL 1.4.
kchibisov marked this conversation as resolved.
Show resolved Hide resolved


# Version 0.32.1
13 changes: 12 additions & 1 deletion glutin/src/api/egl/display.rs
Original file line number Diff line number Diff line change
@@ -362,7 +362,18 @@ impl Display {
handle.connection.map_or(egl::DEFAULT_DISPLAY as *mut _, |c| c.as_ptr()),
)
},
RawDisplayHandle::Gbm(handle) if extensions.contains("EGL_MESA_platform_gbm") => {
RawDisplayHandle::Gbm(handle)
// NOTE: Some drivers report that they support the KHR GBM extension without EGL 1.5 client, so
// work around that here by checking the KHR GBM extension as well. The MESA and KHR extensions have
// the same constant values, thus it'll work regardless.
//
// They do require EXT during the runtime as well, so we don't change the display
// to Khr here.
kchibisov marked this conversation as resolved.
Show resolved Hide resolved
//
// See https://github.com/rust-windowing/glutin/issues/1708.
if extensions.contains("EGL_MESA_platform_gbm")
|| extensions.contains("EGL_KHR_platform_gbm") =>
{
(egl::PLATFORM_GBM_MESA, handle.gbm_device.as_ptr())
},
RawDisplayHandle::Drm(_) => {