-
Notifications
You must be signed in to change notification settings - Fork 927
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
[wgpu-hal] Upgrade to ash 0.38
#5504
Conversation
09d3daf
to
da725f4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
@MarijnS95: Do you think you'll be able to attend to this soon? I'm excited to see quite a few duplicate dependencies like |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I think once merge conflicts are resolved, it is ready to go |
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.
Looks good to me as well!
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.
CI is mad, but lets go :)
@cwfitzgerald Maybe I broke that with the change in features for It is also a tad unfortunate that local |
The cause of this error is now obvious. With this PR there's no direct dependency on $ cargo tree -e features --target x86_64-pc-windows-msvc
...
│ │ ├── wgpu-hal v0.20.0 (/home/marijn/Code/TraverseResearch/wgpu/wgpu-hal)
...
│ │ │ ├── ash feature "default"
│ │ │ │ ├── ash v0.37.3+1.3.251
│ │ │ │ │ └── libloading feature "default"
│ │ │ │ │ └── libloading v0.7.4
│ │ │ │ │ ├── winapi feature "default" (*)
│ │ │ │ │ ├── winapi feature "errhandlingapi"
│ │ │ │ │ │ └── winapi v0.3.9
... So we now have one more explicit feature dependency to list in |
https://github.com/ash-rs/ash/releases/tag/0.38.0 In this release a lot of breaking changes have been made: builder structs are dropped in favour of always having a lifetime parameter available on every raw Vulkan structure (when they contain one or more pointers). This massively contributes to lifetime (and mutable aliasing) safety, but requires significant changes to some uses in `wgpu-hal`. All function pointer loaders for both Vulkan core and extensions have moved into the root of `ash::`, making `ash::vk::` a more pure `sys`-like module. Extensions have their own `ash::<prefix>::<ext>` module to clearly separate and group their items from the core. Besides `NAME` and the usual `*Fn` wrappers, the handwritten `extensions` module is now only available via this path. This to combat the previous inconsistency between `ash::KhrSomeExtFn::name()` vs `ash::extensions::khr::SomeExt::name()`. The Vulkan core clearly splits functions across `device` and `instance` functions, to keep functions that can be loaded without a dispatch-table for a device via `get_device_proc_addr()` apart from instance functions. This concept has now been applied to extension functions, making it possible to load them optimized for a device too (when the shared table would previously include instance functions and require the whole thing to be loaded via `get_instance_proc_addr()`), and in the rare case of 3 hand-written extension wrappers: load instance functions via `get_device_proc_addr()` resulting in `NULL` pointers. Finally, a few new helpers like `_as_slice()` and `_as_c_str()` are available (the former only for statically-sized struct-owned arrays with a length delimiter field) to simplify commonly written patterns.
Thanks for the work on this and seeing this through to the end! |
No worries, I hope you can all benefit/enjoy the incremental improvements in the latest |
https://github.com/ash-rs/ash/releases/tag/0.38.0
In this release a lot of breaking changes have been made: builder structs are dropped in favour of always having a lifetime parameter available on every raw Vulkan structure (when they contain one or more pointers). This massively contributes to lifetime (and mutable aliasing) safety, but requires significant changes to some uses in
wgpu-hal
.All function pointer loaders for both Vulkan core and extensions have moved into the root of
ash::
, makingash::vk::
a more puresys
-like module. Extensions have their ownash::<prefix>::<ext>
module to clearly separate and group their items from the core. BesidesNAME
and the usual*Fn
wrappers, the handwrittenextensions
module is now only available via this path. This to combat the previous inconsistency betweenash::KhrSomeExtFn::name()
vsash::extensions::khr::SomeExt::name()
.The Vulkan core clearly splits functions across
device
andinstance
functions, to keep functions that can be loaded without a dispatch-table for a device viaget_device_proc_addr()
apart from instance functions. This concept has now been applied to extension functions, making it possible to load them optimized for a device too (when the shared table would previously include instance functions and require the whole thing to be loaded viaget_instance_proc_addr()
), and in the rare case of 3 hand-written extension wrappers: load instance functions viaget_device_proc_addr()
resulting inNULL
pointers.Finally, a few new helpers like
_as_slice()
and_as_c_str()
are available (the former only for statically-sized struct-owned arrays with a length delimiter field) to simplify commonly written patterns.Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories
#5501
Description
Describe what problem this is solving, and how it's solved.
New crate release of
ash
that users will likely want to start using, especially since it exposes a many more Vulkan extensions (generated against a newer spec) and has significant lifetime-safety improvements and other usability-refactors.Testing
Explain how this change is tested.
cargo r -p wgpu-examples
for a few of them.Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.This fails on the
water
test, but also ontrunk
. As seen when runningcargo r -p wgpu-examples water
, a lot ofSYNC-HAZARD-WRITE-AFTER-WRITE
validation issues are detected.CHANGELOG.md
. See simple instructions inside file.I realize that this is a bit of a sloppy PR with some
TODO
s, which I'd like to discuss to find the cleanest way forward :)