-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
Glutin version 0.32.1 #1697
Merged
Merged
Glutin version 0.32.1 #1697
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When testing the `glutin` example on Android, after suspending and resuming the app no triangle appears. As it turns out the `winit 0.30` bump in #1678 never reuses the `not_current_context` that was set apart in `suspend()`, but creates a new one, without re-running initialization code such as creating the `Renderer`. Partially restore original code before the `winit 0.30` bump, which never created a context in `resume()` because it was already available before the loop started (and moved back in place in `suspend()`). Note also that more initialization code that now (unnecessarily) lives in `resume()` used to be outside of the loop.
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 EGL_EXT_device_base specification 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 & !Q leads to a different error message than before B & !E & !Q no longer errors !B & E & Q no longer errors
Change the calling convention of the `EglGetProcAddress` declaration to `extern "system"` to automatically use the correct calling convention for the platform.
…EXT` By casting a `null_mut()` ptr and passing it directly _by value_ to `QueryDisplayAttribEXT()`, the function ignores writing the output as it didn't receive an address (it received `NULL`) to write the device to. Instead we should take the _pointer address of this `null_mut()` pointer_ and provide that to the function instead so that it can _overwrite_ it with a pointer to the requested `eglDevice`. This is even more clear when allocating a `MaybeUninit` in which the pointer will be returned, which has a convenient `.as_mut_ptr()` member to pass its pointer value directly into `QueryDisplayAttribEXT()`.
It was incorrectly ported that the display was recreated, though, given that passing the same arguments to it will yield the same results it was still working as expected.
EGL doesn't differentiate between objects created by different extensions, and the display version check could be done, after we've created it, so ensure what display we actually created and use its functions.
This extension (together with the optional `EGL_EXT_device_drm_render_node` extension) allows querying the DRM primary and render device node filenames from `EGLDevice`, to help associating them with DRM devices. Additionally a platform display _can_ be created with a DRM file descriptor with master permissions, but this is only useful in situations where EGL might fail to open a file descriptor itself or will fail to acquire master permissions (which are only required when the implementation needs to "modify output attributes": but no behaviour is defined by this extension that requires this). This file descriptor will be duplicated by the implementation if it needs to use it beyond the call to `eglGetPlatformDisplayEXT()`, and does not need to be kept alive by the caller. Note that `EGL_EXT_output_drm` is omitted for now, because it relies on the equally unimplemented `EGL_EXT_output_base` extension.
In particular `wantsBestResolutionOpenGLSurface` and `wantsLayer`. This is currently done by libraries, like winit, but it's really our job to do this.
kchibisov
force-pushed
the
glutin-0321
branch
from
September 11, 2024 16:30
c44a2c7
to
c6301f8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.