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

Redo layer creation to create a sub layer if needed #19

Merged
merged 12 commits into from
Sep 9, 2024

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Sep 4, 2024

Redo layer creation to match what's outlined in gfx-rs/wgpu#6107.

A deviation from that PR is that we track the bounds and scale factor from the super layer using observers. This fixes the issue in gfx-rs/wgpu#6107 (comment), and is also what I intend to do in Wgpu, but it's just a huge hazzle to do correctly without objc2, which Wgpu doesn't yet use.

The new API is:

  • Layer::from_layer
  • Layer::from_ns_view (replaces appkit::metal_layer_from_ns_view and appkit::metal_layer_from_handle)
  • Layer::from_ui_view (replaces uikit::metal_layer_from_ui_view and uikit::metal_layer_from_handle)

Fixes #11 by removing dependency on raw-window-handle (since it's one line for the user to get a layer from the handle).

I have tested this with a fork of ash, of vulkano and of wgpu, seems to work fine there.

@madsmtm madsmtm added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Sep 4, 2024
@madsmtm
Copy link
Member Author

madsmtm commented Sep 4, 2024

I think I intend to release v1.0 fairly shortly after this, as I feel like the API surface is now quite small, and I've spent a long time ensuring that the behaviour is as expected.

@madsmtm madsmtm force-pushed the proper-layer-init branch 2 times, most recently from 5a1caeb to 56a1aa3 Compare September 4, 2024 10:49
@madsmtm madsmtm merged commit 820f241 into master Sep 9, 2024
4 checks passed
@madsmtm madsmtm deleted the proper-layer-init branch September 9, 2024 11:18
@MarijnS95 MarijnS95 mentioned this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Support multiple versions of raw-window-handle concurrently?
1 participant