-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[metal] Use raw-window-metal to do layer creation
#6210
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
base: trunk
Are you sure you want to change the base?
Conversation
dad5c3c to
ffabb52
Compare
3714887 to
9565109
Compare
Wumpf
left a comment
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.
very appreciated, having that code as part of raw-window-metal sounds great to me :)
As pointed out this will have to wait for the objc2 pr to be approved. cc: @jimblandy
(therefore not putting ✔️ just yet so this doesn't get merged ahead of time)
|
I've tested this and it still adds some noticeable (especially in comparison) with the way it was before previous PR (#6107) had been merged. I've gone into a bit further details here #6107 (comment). |
47095be to
ff90830
Compare
f423d1a to
0931958
Compare
0931958 to
330f051
Compare
330f051 to
f199b99
Compare
f199b99 to
7813f4e
Compare
This removes the manual implementation introduced in 7b00140.
7813f4e to
f084091
Compare
EDIT:
raw-window-handle's implementation, as described below, was used in #7026. This PR now only updates to use the actualraw-window-handlecrate.You know, all that code and documentation I just wrote in #6107? Let's throw it
awayinto a library, so thatwgpu,ash,vulkano,i-slint-renderer-skiaand so on can all benefit from it.raw-window-metalis that library (existed previously, I've updated it in rust-windowing/raw-window-metal#19).This makes Wgpu depend transitively on
objc2, so the concerns about doing that apply here as well, see also #5641.Description
Use the
raw-window-metalcrate to do layer creation. This uses much the same approach as we do currently, except that it also uses observers internally, which fixes resizing on high DPI screens when using Wgpu together with anNSViewusing auto-layout.Though it probably won't matter much, it's also more reliable to update the scale factor this way, rather than haphazardly in
configure.The logic in
raw-window-metalcould be re-implemented in Wgpu to avoid the dependency, however I deemed it complex enough that I thought it wiser to centralize the implementation in one place.Testing
See #6107 (comment).
Checklist
cargo fmt.cargo clippy.cargo xtask testto run tests.CHANGELOG.md. See simple instructions inside file.raw-window-metal#7026.