-
-
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
Implement priority hints for EGL #1700
Conversation
2625fe2
to
c63d6a8
Compare
You need to add a |
I'm fine with adding such a check just for android target. |
c63d6a8
to
7e95d85
Compare
Add `GlContext::priority` and `ContextAttributesBuilder::with_priority` to get and set context priority respectively. Fixes rust-windowing#1694. Fixes rust-windowing#1645.
7e95d85
to
bca8a93
Compare
I've rabased it and added a getter, which could be used to log what level of priority context is using. |
Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, sorry I was late to the review request and only have one minor nit that doesn't need to be addressed.
#[cfg(android_platform)] | ||
let android = extensions.contains("EGL_ANDROID_front_buffer_auto_refresh") | ||
&& extensions.contains("EGL_ANDROID_create_native_client_buffer"); | ||
#[cfg(not(android_platform))] | ||
let android = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wanted less #[cfg]
conditional compilation, perhaps this could have been let android = cfg!(android_platform) && ...;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, and decided to do it that way for now, since we already do things like that...
Fixes #1645
Fixes #1694
This PR adds a way to specify the priority for contexts. I mostly used the term hint, as its not guaranteed for various reasons that the context actually gets the priority.
Don't know if it makes sense to guarantee the priority. In Chromium it's also only used as a hint.
I also probably should extend the extension check as it is not correctly reported on Android.
https://github.com/chromium/chromium/blob/main/ui/gl/gl_display.cc#L814
Theoretically the extension also exists for GLX but Mesa for example doesn't support it.
CHANGELOG.md
if knowledge of this change could be valuable to users