Skip to content
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

Add layer observer based on raw-window-metal #7026

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Jan 29, 2025

After #6107, resizing is still broken, and the right way to fix it is to create a sublayer that resizes itself based on the superlayer using key-value observing (see this for an introduction).

I have written a crate for this already, called raw-window-metal and filed #6210, but that crate depends on objc2, which is still under review by Firefox/Mozilla. So in the meantime, let's fix this directly in Wgpu.

Fixes #7011 and a few other issues, and should be fairly cleanly backport-able to v23 or v24 if desired.

I didn't write all that much documentation and safety comments here, and was kinda sloppy in some places, because the hope is that this fix will be temporary.

Testing
Tested by cherry-picking onto v23.1.0, and running Bevy's mobile example in the iOS simulator.

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@madsmtm madsmtm requested a review from a team as a code owner January 29, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resizing in iOS doesn't work correctly after #6107
2 participants