-
Notifications
You must be signed in to change notification settings - Fork 953
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
Context dynamic dispatch #3051
Context dynamic dispatch #3051
Conversation
166eed4
to
e265d55
Compare
This, is exciting! I've been wanting a way to switch between the WebGL 2 and WebGPU backends at runtime. On linux I'm getting an error when trying to run the
|
@expenses I have fixed the bug and all the tests and examples (except for mipmap due to features) run on my system (radv Vulkan). I managed to forget that a |
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 need to take another look inside my IDE to see if I see anything weird, but here's some first pass comments.
d3d174e
to
d8bc266
Compare
621bdf6
to
a0dcf36
Compare
Codecov Report
@@ Coverage Diff @@
## master #3051 +/- ##
==========================================
- Coverage 65.64% 64.27% -1.37%
==========================================
Files 82 83 +1
Lines 39479 42260 +2781
==========================================
+ Hits 25915 27164 +1249
- Misses 13564 15096 +1532
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
91f131d
to
cd74fd2
Compare
a61eacf
to
14d2671
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.
Alright, I think I can basically say that this is good enough to merge, minus the mentioned comments. I don't think we can catch all the issues with this massive refactor by just staring at it, so I want to merge and improve iteratively.
I do think there might be some macro magic that makes the amount of boilerplate we need less, but we can stew on that at some future time.
df1f94e
to
225fcc7
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.
Needs conflicts resolved, but I think it's time to just pull the trigger on this.
10b5b6f
to
52889ff
Compare
52889ff
to
ceb4723
Compare
I am now getting an error when building a
This happens when calling
The |
Yep the bug is known, it's being tracked in #3430 |
Checklist
cargo clippy
.RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown
if applicable.Description
This pull request does most of the work required to allow wgpu backends to be set at runtime. In the future this would allow selection between webgl2 and webgpu on web and on native other backends (including my use case which crosses process boundaries).
What would need to be done after this is to solidify the internal Context trait and types so those can be publicly exported.
Testing
This pull request needs testing with crates across the ecosystem. The dynamic dispatch in the internals does pass the tests in wgpu, but best to be safe.
There hasn't been any testing for the web backend. There could be errors that may have been added during the dynamic dispatch internal mess. However the testing situation for the web has been grim for a while.