[metal] Use raw-window-metal to do layer creation - #6210
Merged
Conversation
9 tasks
madsmtm
force-pushed
the
raw-window-metal
branch
2 times, most recently
from
September 9, 2024 20:37
dad5c3c to
ffabb52
Compare
madsmtm
marked this pull request as ready for review
September 9, 2024 20:37
This was referenced Sep 9, 2024
madsmtm
force-pushed
the
raw-window-metal
branch
from
September 11, 2024 20:41
3714887 to
9565109
Compare
Wumpf
reviewed
Oct 29, 2024
Wumpf
left a comment
Member
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). |
cwfitzgerald
marked this pull request as draft
December 11, 2024 16:42
Member
This was referenced Jan 28, 2025
madsmtm
force-pushed
the
raw-window-metal
branch
3 times, most recently
from
February 25, 2025 05:32
47095be to
ff90830
Compare
madsmtm
force-pushed
the
raw-window-metal
branch
3 times, most recently
from
April 25, 2025 20:02
f423d1a to
0931958
Compare
madsmtm
force-pushed
the
raw-window-metal
branch
from
August 23, 2025 19:58
0931958 to
330f051
Compare
madsmtm
force-pushed
the
raw-window-metal
branch
from
October 5, 2025 21:42
330f051 to
f199b99
Compare
madsmtm
force-pushed
the
raw-window-metal
branch
2 times, most recently
from
November 3, 2025 20:53
7813f4e to
f084091
Compare
madsmtm
force-pushed
the
raw-window-metal
branch
from
December 10, 2025 19:23
f084091 to
5bc580f
Compare
This removes the manual implementation introduced in 7b00140.
madsmtm
force-pushed
the
raw-window-metal
branch
from
January 21, 2026 15:13
5bc580f to
17ddcb1
Compare
andyleiserson
marked this pull request as ready for review
January 26, 2026 20:13
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.