-
Notifications
You must be signed in to change notification settings - Fork 186
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
Don't link Vulkan by default #526
Conversation
5ba861c
to
64ee2fe
Compare
64ee2fe
to
cc45469
Compare
887e355
to
71a63c4
Compare
203ec3d
to
44ed205
Compare
@@ -7,5 +7,5 @@ edition = "2018" | |||
[dependencies] | |||
winit = "0.25.0" | |||
image = "0.10.4" | |||
ash = { path = "../ash" } | |||
ash = { path = "../ash", default-features = false, features = ["linked", "debug"] } |
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.
It might be helpful to have some explanation as to why the examples are using linked
instead loaded
. I assume this is because the examples are requiring the validation layer from the SDK. If that's not the case, the examples should probably use loaded
to minimize friction.
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.
Added a note.
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.
@aloucks The note is nice, but keep in mind that dynamic linking or (dynamic) runtime loading has no impact on being able to use the validation layers. It "just so happens" that both the .lib
(needed for dynamic linking on Windows) (on Linux the runtime .so
is used for this) and validation layers ship with the SDK.
FWIW I thought the examples would use linked
to both showcase this feature, and because examples are generally ran on the same machine (ie. build environment == runtime environment) so it makes sense that the user intends to develop Vulkan applications, hence has the ability to both "develop" (with the SDK) and run them.
Does the CI test job still need to install |
Yes, to allow tests/examples to be built with the |
44ed205
to
4cdc097
Compare
ash/src/entry.rs
Outdated
/// Load default Vulkan library for the current platform | ||
/// | ||
/// Prefer this over [`linked`](Self::linked) when your application can gracefully handle | ||
/// environments that lack Vulkan support, and when the build environment might not have the | ||
/// Vulkan loader available. |
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.
It might be helpful to rephrase this in such a way that emphasizes the impact on downstream dependencies.
Entry::loaded
should be preferred unless you explicitly want to impose a dependency on the Vulkan SDK (e.g. perhaps you depend on validation layers). For example, bevy
depends on wgpu
. If wgpu
decided to used Entry::linked
, every developer who attempted to experiment with bevy would need to install the Vulkan SDK or face compile time linker errors.
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.
Adjusted the wording to make the build environment requirements clearer.
4cdc097
to
a583f6c
Compare
a583f6c
to
3f0fdef
Compare
This was found to be unreasonably disruptive to downstream CI configurations.
3f0fdef
to
48621f5
Compare
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.
I think this reverts back to the old behavior so I can approve it. @MaikKlein I think it would make sense to push a new release with this fix as soon as it's merged. What do you think?
/// Compared to [`load`](Self::load), this is infallible, but requires that the build | ||
/// environment have Vulkan development packages installed (e.g. the Vulkan SDK, or Ubuntu's | ||
/// libvulkan-dev), and prevents the resulting binary from starting in environments that do not | ||
/// support Vulkan. |
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.
s/support Vulkan/ship with Vulkan libraries
?
@@ -7,5 +7,5 @@ edition = "2018" | |||
[dependencies] | |||
winit = "0.25.0" | |||
image = "0.10.4" | |||
ash = { path = "../ash" } | |||
ash = { path = "../ash", default-features = false, features = ["linked", "debug"] } |
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.
@aloucks The note is nice, but keep in mind that dynamic linking or (dynamic) runtime loading has no impact on being able to use the validation layers. It "just so happens" that both the .lib
(needed for dynamic linking on Windows) (on Linux the runtime .so
is used for this) and validation layers ship with the SDK.
FWIW I thought the examples would use linked
to both showcase this feature, and because examples are generally ran on the same machine (ie. build environment == runtime environment) so it makes sense that the user intends to develop Vulkan applications, hence has the ability to both "develop" (with the SDK) and run them.
@@ -22,6 +22,7 @@ raw-window-metal = "0.1" | |||
|
|||
[dev-dependencies] | |||
winit = "0.19.4" | |||
ash = { path = "../ash", version = "0.34", default-features = false, features = ["linked"] } |
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.
That's a nice way to satisfy required-features = ["ash/linked"]
:)
This was found to be unreasonably disruptive to downstream CI configurations. Fixes #525.
I opted to additionally enable
loaded
by default, and repositionEntry::load
aboveEntry::linked
, so that a working configuration is available and easily found out of the box.