-
Notifications
You must be signed in to change notification settings - Fork 944
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 dynamic dispatch, towards fewer generics in wgpu-core #6002
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wumpf
changed the title
HAL dynamic dispatch towards fewer generics in wgpu-core
wgpu-hal dynamic dispatch towards fewer generics in wgpu-core
Jul 20, 2024
Wumpf
changed the title
wgpu-hal dynamic dispatch towards fewer generics in wgpu-core
wgpu-hal dynamic dispatch, towards fewer generics in wgpu-core
Jul 20, 2024
Wumpf
force-pushed
the
dynamic-hal-dispatch
branch
3 times, most recently
from
July 24, 2024 07:45
e73fb15
to
8a9cbee
Compare
6 tasks
Wumpf
force-pushed
the
dynamic-hal-dispatch
branch
5 times, most recently
from
August 3, 2024 10:29
739adb9
to
a498175
Compare
Wumpf
force-pushed
the
dynamic-hal-dispatch
branch
9 times, most recently
from
August 10, 2024 10:10
19ba1f1
to
a2bb962
Compare
…ng that can already be implemented with the existing dynamic type variations
bindgroup fixup
…ffects from there leading to boxing of almost all hal resources
…emaining Device::raw_typed
gfx_select macros are empty husks now that are waiting to be removed
Wumpf
force-pushed
the
dynamic-hal-dispatch
branch
from
August 10, 2024 12:17
a2bb962
to
bef23ee
Compare
closing in favor of 3 part pr series coming up soon! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Connections
Description
Still heavy work in progress!
This latest attempt to degenerification of wgpu core tries to be as straight forward as possible:
DynDevice
,DynCommandEncoder
etc.)&A::CommandEncoder
(and similar) instead pass around& dyn DynCommandEncoder
Box<&dyn DynBuffer>
(and similar)<A: hal::API>
from all the wgpu-core typesPrevious more complex attempts tried to avoid boxing as much as possible, I'm deliberately doing here the opposite, well aware that this may cost us! But nobody actually measured how much yet and neither have I, so the jury is still out on this.
The hope is that this approach is simple enough that we can pull it off and cheap enough that we can worry about optimizing things later (it's not too hard to come up with ideas on how to tackle ensuing costs, we just have to know what to optimize first!).
I'm keeping this in a fairly landable state at every step (minus Metal & web things which I'm not testing all the time) and try to keep steps granular, BUT....
Testing
Hopefully covered by existing tests ;-)
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.