-
Notifications
You must be signed in to change notification settings - Fork 1k
Degenerification part 2/3: Removal of lifetimes from wgpu-core
#6099
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
Conversation
fd36733
to
9927994
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.
Glorious
@@ -1,7 +1,7 @@ | |||
/*! Resource State and Lifetime Trackers | |||
|
|||
These structures are responsible for keeping track of resource state, | |||
generating barriers where needed, and making sure resources are kept | |||
generating barriers where needednd making sure resources are kept |
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.
nit: looks like the next few comment modifications are accidental.
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.
oops, one of my many regex replacements must have gone sideways!
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.
My eyes glazed over by the 457th file, but this is looking good and nothing that deserves blocking. I could probably find something to bikeshed if I really tried, but lets favor landing.
2f7294a
to
5f6c8ba
Compare
…s buffer operations
…PassTimestampWrites usable with DynQuerySet
collateral: ComputePass uses DynCommandEncoder during recording
bindgroup fixup
…ffects from there leading to boxing of almost all hal resources
gfx_select macros are empty husks now that are waiting to be removed
5f6c8ba
to
0fd56eb
Compare
merged in part 3 |
Connections
wgpu-hal
DynDevice
& friends #6098wgpu-core
#6099gfx_select
, remove compute/render pass indirections #6100Description
This is where the magic happens!
Almost all interaction of
wgpu-hal
inwgpu-core
use now the previously introducedDyn
backend abstraction.To achieve this, all hal resources are allocated as
Box<dyn hal::DynResource>
(with more concrete types for safety & easy of use).Since hal resource are no longer distinguish type,
Hubs
collapses to just a singleHub
.AnyDevice
is no longer needed since every device is just aBox<dyn hal::DynDevice>
Since
wgpu-core
types are extremely intertwined (most of them have anArc<Device>
) this happens in very few commits. However, I split out a few rough iterations with two major "unravelings": first boxing & dyn passing, then hub simplification & actual generic removal.In order to not have this PR spill into
wgpu
,gfx_select
has been stripped down to pass-through, it will be removed entirely in Part 3.Testing
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.[ ] Add change tochangelog in Part 3CHANGELOG.md
. See simple instructions inside file.