Enumerate adapters? #2022
-
Is there ever any intention of allowing more specific adapter selection by users? For multi GPU systems and offscreen rendering it makes sense to have a very specific choice of adapter. I saw an enumerate_adapters function but it looks very internal and not something usable from client code to actually select adapter from the results of enumerate_adapters. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
enumerate_adapters is exactly the function you should be using. You get a iterator of adapters which you can then use to get information We use it as part of our user space utilities: https://github.com/gfx-rs/wgpu/blob/master/wgpu/src/util/init.rs#L40-L59 selects an adapter based on its name. |
Beta Was this translation helpful? Give feedback.
-
Perfect, thank you so much for that confirmation. |
Beta Was this translation helpful? Give feedback.
-
That function is part of wgpu-rs. Are there plans to expose something similar in WebGPU and/or wgpu-native? |
Beta Was this translation helpful? Give feedback.
enumerate_adapters is exactly the function you should be using. You get a iterator of adapters which you can then use to get information
Adapter::features
Adapter::limits
Adapter::get_info
etc. From there you can decide on an adapter and callrequest_device
on it.We use it as part of our user space utilities: https://github.com/gfx-rs/wgpu/blob/master/wgpu/src/util/init.rs#L40-L59 selects an adapter based on its name.