[metal] Use raw-window-metal to do layer creation#6210
Merged
andyleiserson merged 1 commit intogfx-rs:trunkfrom Jan 26, 2026
Merged
[metal] Use raw-window-metal to do layer creation#6210andyleiserson merged 1 commit intogfx-rs:trunkfrom
raw-window-metal to do layer creation#6210andyleiserson merged 1 commit intogfx-rs:trunkfrom
Conversation
9 tasks
dad5c3c to
ffabb52
Compare
This was referenced Sep 9, 2024
3714887 to
9565109
Compare
Wumpf
reviewed
Oct 29, 2024
Member
Wumpf
left a comment
There was a problem hiding this comment.
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)
7 tasks
|
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). |
Member
This was referenced Jan 28, 2025
47095be to
ff90830
Compare
f423d1a to
0931958
Compare
0931958 to
330f051
Compare
330f051 to
f199b99
Compare
7813f4e to
f084091
Compare
f084091 to
5bc580f
Compare
This removes the manual implementation introduced in 7b00140.
5bc580f to
17ddcb1
Compare
andyleiserson
approved these changes
Jan 26, 2026
This file contains hidden or 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
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.
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.