-
Notifications
You must be signed in to change notification settings - Fork 437
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 PhysicalDevice::presentation_support
#2562
Conversation
2d8e44b
to
be5fa57
Compare
@@ -34,6 +34,10 @@ vulkano-macros = { workspace = true, optional = true } | |||
objc = { workspace = true } | |||
core-graphics-types = { workspace = true } | |||
|
|||
[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", target_os = "linux", target_os = "netbsd", target_os = "openbsd", target_os = "solaris"))'.dependencies] |
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.
Wouldn't it be easier to write something like:
cfg(all(unix, not(target_os = "foo"), not(target_os = "bar")))
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.
Easier in what way? The list would be longer. But that's besides the point. I explicitly did not want to do that because I really don't like the idea of opt-out conditional compilation, as new targets can always be added.
be5fa57
to
f488c3a
Compare
Looks good! Can you fix the conflict, then I'll merge. |
f488c3a
to
74f890e
Compare
Rebased. |
I should have merged... that compare is useless to see what changed. Sorry about that. |
This adds a function that abstracts away the platform-specific presentation support calls akin to
Surface::from_window
, allowing you to determine presentation support to the surface of any window of a given event loop. This addresses two issues:Resumed
callback, which makes people think that you have to create the whole device in that callback, when that's not the case. This addition is going to make updating to winit 0.30 easier.PhysicalDevice::surface_support
. This also fixes the issues that the multi-window example was having.PhysicalDevice::surface_support
is essentially only usable if you have a window since right after the creation of the event loop and when the window exists for the app's lifetime. Therefore, I replaced allPhysicalDevice::surface_support
calls in the examples withPhysicalDevice::presentation_support
to promote the better alternative (and for the future when we update to winit 0.30).Unfortunately, this function was not implementable without adding dependencies for X11 libraries on X11 platforms. I added a default feature same as winit does, so the user can disable the dependencies if they e.g. only support Wayland.
Changelog: