glutin
glutin copied to clipboard
Fix logic in egl Device::query_device
The previous test would mistakenly return an error if the extensions contain "EGL_EXT_device_base" but not the two others. As stated by the comment, and in https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_device_base.txt , it is supposed to contain the other two.
The cases that should not return an error are:
- contains EGL_EXT_device_base (
B) - contains both EGL_EXT_device_enumeration (
E) and EGL_EXT_device_query (Q)
The overall effects of this patch in terms of those three extensions are:
!B & E & !Qleads to a different error message than beforeB & !E & !Qno longer errors!B & E & Qno longer errors
cc @i509VCB I think the test was similar to the one in smithay?
Huh, looks like smithay is requiring all three are present: https://github.com/Smithay/smithay/blob/41712470abede74dab8a039ce048c70d56115ce6/src/backend/egl/device.rs#L31
Based on the existing comment in the glutin source, the check was intended to do the correct thing, but just got the operators mixed up in the code. The minimal diff would have been just substituting && for || and vice versa, but I also reordered it to check for the combined extension first.
The previous test would mistakenly return an error if the extensions contain "EGL_EXT_device_base" but not the two others. As stated by the comment, and in https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_device_base.txt , it is supposed to contain the other two.
The cases that should not return an error are:
- contains EGL_EXT_device_base
- contains both EGL_EXT_device_enumeration and EGL_EXT_device_query
The changes look correct the specification for EGL_EXT_device_base states the following:
Add to section "3.2 Devices"
"EGL_EXT_device_base is equivalent to the combination of the
functionality defined by EGL_EXT_device_query and
EGL_EXT_device_enumeration."