-
Hi, I’m trying to create an iOS and Mac app that does compute work using WGPU compute shaders. I have this working without issues on macOS, but on iOS I get the following error: This is my set-up code: let instance = wgpu::Instance::new(wgpu::Backends::all());
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptionsBase {
power_preference: wgpu::PowerPreference::HighPerformance,
force_fallback_adapter: false,
compatible_surface: None,
})
.block_on()
.ok_or(Error::new("Couldn’t create the adapter."))?;
let (device, queue) = adapter
.request_device(&Default::default(), None)
.block_on()
.map_err(|error| Error::new(format!("Couldn’t request device: {}", error).as_str()))?; Output: I know it’s possible to get WGPU working on iOS (here’s an example), but I can’t see what’s that different to my code compared to theirs. I’ve tried passing in a As I said, it runs fine on macOS, and it also runs as an iPad app on Apple Silicon. However the error is shown when running in the simulator or on device. Any help would be very much appreciated. Let me know if you need any more details. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@rizerco All iOS adapters are .request_adapter(&wgpu::RequestAdapterOptionsBase {
power_preference: wgpu::PowerPreference::LowPower, <---
force_fallback_adapter: false,
compatible_surface: None,
}) Also, you can enumerate adapters and pick the right one: for a in instance.enumerate_adapters(wgpu::Backends::all()) {
log::info!("{:?}", a.get_info())
} |
Beta Was this translation helpful? Give feedback.
@rizerco Sorry, I misread your question. You can't get a device, not an adapter. You can try
DeviceDescriptor
fromhello-triangle
example:Also, you can set RUST_LOG environment variable (RUST_LOG=trace) and see what's going wrong in log.