-
Notifications
You must be signed in to change notification settings - Fork 438
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
macOS/iOS: Use raw-window-metal
to get a CAMetalLayer
from raw-window-handle
#2561
Conversation
I don't think support for extensions should be removed. Vulkano should work on any Vulkan-supporting device, including old ones with deprecated extensions. |
Also note that vulkano-win is deprecated. If you revert the breaking changes to |
470d258
to
43807d1
Compare
Thing is, the support that Vulkano previously used for these two included the somewhat implicit feature that you can pass But sure, I'll keep the extension code itself in. |
I've released I guess if we wanted to keep this free from breaking changes, we could keep the |
I think removing that function is fine. Apple support was certainly scuffed and this looks like a fine improvement which I'm grateful for. I just don't like the idea of removing support for extensions and updating vulkano-win. |
About |
Yes that's certainly the problem with deprecation. We have to keep releasing versions otherwise it wouldn't be deprecation. I would have preferred vulkano-win would just die already because people keep updating it despite it being deprecated, not part of the workspace, and despite this comment. The idea of deprecation is that it strictly continues to work. Anything more is a waste of time on everyone's part, and even has the potential to instroduce new bugs like every change does. Anyway, that's enough ranting from me. The PR LGTM but neither I nor Rua have a way to test it. @hakolao would you happen to have time? |
43807d1
to
3ea5f7e
Compare
My mac's so slow nowadays so I don't want to do much with it. I ran the triangle fine, anything else to test? @marc0246. Resizing was smooth |
Thanks Okko! The examples all do the windowing the same so surely that's enough. @Rua do you have anything else to add? |
No, looks good now. Just a merge conflict. |
The way `raw-window-metal` works is by creating a layer, and inserting that as a sublayer, just like we did on iOS before. The bounds are then kept in-sync with an observer, ensuring smooth resizing. This also fixes compilation errors on iOS, and adds preliminary support for tvOS. The implementation now solely uses `VK_EXT_metal_surface`, which was added in 2018, instead of `VK_MVK_ios_surface` / `VK_MVK_macos_surface`, which are deprecated, and only available a year and a half earlier anyhow. Note that apart from the above, there is a slight behavioral change on macOS: we no longer set `edgeAntialiasingMask` on the layer, as it's not really required, and allows us to avoid depending on `objc2` directly. It was introduced without motivation in 40e0b24, so I doubt anyone uses it, and if they do, they can change it on the layer themselves.
3ea5f7e
to
5e8b57a
Compare
Thank you for blessing us with raw-window-metal @madsmtm! It looks like an awesome addition to the ecosystem ❤️ |
raw-window-metal
crate itself. Surface construction should be covered by existing examples.cargo clippy
on the changes.cargo +nightly fmt
on the changes.The logic for creating the
CAMetalLayer
if it doesn't exist is complex, and currently Vulkano does it wrong and prevents Winit from scheduling redraw events at the correct time. I have abstracted this away intoraw-window-metal
, see the major PR here, it works is by creating a layer, and inserting that as a sublayer, just like we did on iOS before. The bounds are then kept in-sync with an observer, ensuring smooth resizing.This PR also fixes the compilation errors on iOS, and adds preliminary support for tvOS.
The implementation now solely uses
VK_EXT_metal_surface
, which was added in 2018,and I've removed support for, which are deprecated, and only available a year and a half earlier anyhow.VK_MVK_ios_surface
/VK_MVK_macos_surface
See also corresponding PR to
ash
and PR towgpu
.Changelog: