Skip to content

Degenerification part 2/3: Removal of lifetimes from wgpu-core#6099

Closed
Wumpf wants to merge 49 commits intogfx-rs:trunkfrom
Wumpf:degenerification-part2
Closed

Degenerification part 2/3: Removal of lifetimes from wgpu-core#6099
Wumpf wants to merge 49 commits intogfx-rs:trunkfrom
Wumpf:degenerification-part2

Conversation

@Wumpf
Copy link
Copy Markdown
Member

@Wumpf Wumpf commented Aug 10, 2024

Connections

Description
This is where the magic happens!
Almost all interaction of wgpu-hal in wgpu-core use now the previously introduced Dyn 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 single Hub.
AnyDevice is no longer needed since every device is just a Box<dyn hal::DynDevice>

Since wgpu-core types are extremely intertwined (most of them have an Arc<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

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • [ ] Add change to CHANGELOG.md. See simple instructions inside file. changelog in Part 3

@Wumpf Wumpf requested a review from a team as a code owner August 10, 2024 21:18
@Wumpf Wumpf marked this pull request as draft August 10, 2024 21:18
@Wumpf Wumpf force-pushed the degenerification-part2 branch 2 times, most recently from fd36733 to 9927994 Compare August 10, 2024 21:29
@Wumpf Wumpf marked this pull request as ready for review August 10, 2024 21:31
Copy link
Copy Markdown
Contributor

@nical nical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glorious


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
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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!

Copy link
Copy Markdown
Member

@cwfitzgerald cwfitzgerald left a 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.

@ErichDonGubler ErichDonGubler force-pushed the degenerification-part2 branch from 2f7294a to 5f6c8ba Compare August 14, 2024 09:54
Wumpf added 26 commits August 14, 2024 10:55
…ffects from there leading to boxing of almost all hal resources
gfx_select macros are empty husks now that are waiting to be removed
@ErichDonGubler ErichDonGubler force-pushed the degenerification-part2 branch from 5f6c8ba to 0fd56eb Compare August 14, 2024 14:19
@Wumpf
Copy link
Copy Markdown
Member Author

Wumpf commented Aug 14, 2024

merged in part 3

@Wumpf Wumpf closed this Aug 14, 2024
@Wumpf Wumpf deleted the degenerification-part2 branch August 14, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants