Add option to initialize with existing wgpu instance/adapter/device/queue#5319
Add option to initialize with existing wgpu instance/adapter/device/queue#5319Wumpf merged 7 commits intoemilk:masterfrom
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/5319-custom-device |
Wumpf
left a comment
There was a problem hiding this comment.
Nice! I really like having this hook in there.
Comments are entirely about naming & docs, approach & structure looks good to me!
crates/egui-wgpu/src/lib.rs
Outdated
| /// * `WGPU_BACKEND`: `vulkan`, `dx11`, `dx12`, `metal`, `opengl`, `webgpu` | ||
| /// * `WGPU_POWER_PREF`: `low`, `high` or `none` |
There was a problem hiding this comment.
nice, thanks for documenting that! But it should point out that these are only used for picking the default, nothing else
There was a problem hiding this comment.
I've moved this closer to where they are actually used. Maybe they're a bit too hidden now, but idk!
|
Thanks for the speedy review :D Much better names now, definitely was a bit too quick as I adopted this from existing adapter selection code. |
When mixing and matching eframe with other wgpu applications (https://github.com/tracel-ai/burn in my case), it can be helpful to use an existing wgpu setup to initialize eframe with. This PR changes the WpuConfiguration (in a non-backwards compat way :/), to either take some options how to create a wgpu setup, or an existing wgpu setup (consisting of an instance, adapter, device and queue). * [x] I have followed the instructions in the PR template --------- Co-authored-by: Andreas Reich <r_andreas2@web.de>
When mixing and matching eframe with other wgpu applications (https://github.com/tracel-ai/burn in my case), it can be helpful to use an existing wgpu setup to initialize eframe with. This PR changes the WpuConfiguration (in a non-backwards compat way :/), to either take some options how to create a wgpu setup, or an existing wgpu setup (consisting of an instance, adapter, device and queue).