-
Notifications
You must be signed in to change notification settings - Fork 433
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
Fix game of life example on macos #1829
Conversation
I'm not on MacOS so I can't test this, but it seems like a simple enough fix. Can you explain why this fixes it though, and is it maybe something that should be documented in these two functions? |
Apologies for the delay! @Eliah-Lakhin @Rua
Without that, the direct Some references: KhronosGroup/MoltenVK#78 This could be documented somewhere, however I'd think that having it searchable on github might also be enough, and those who use or should use |
I think this should be included as documentation on |
Ok, I’ll add it there! |
@Rua would this be better now? I extracted the layer setting to its own function, so if someone wants to use the |
vulkano-win/src/raw_window_handle.rs
Outdated
/// which implements HasRawWindowHandle and thus can reveal the os-dependent handle | ||
/// which implements HasRawWindowHandle and thus can reveal the os-dependent handle. | ||
/// - Note that if you wish to use this function with MacOS, you will need to ensure that the | ||
/// `CAMetalLayer` is set to the ns_view. You can do that by calling `vulkano_win::set_ca_metal_layer_to_winit` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_surface_from_handle
is not used with Winit, and it doesn't make sense to tell the user to use a function that requires Winit, if they aren't using Winit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I updated once more...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although... One could if they want to retain the ownership of the window else where? Though that's probably not necessary...
Describe in common words what is the purpose of this change, related
Github Issues, and highlight important implementation aspects.
Run
cargo fmt
on the changes.I noticed that on my macos the
create_vk_surface_from_handle
encounters an error:What is done in
winit_to_surface
prevents this. I wasn't even sure why the handle version was used anyway...