Skip to main content

try_init_device_with_api

Function try_init_device_with_api 

Source
pub fn try_init_device_with_api<G: GraphicsApi>(
    setup: WgpuSetup,
    options: RuntimeOptions,
) -> Result<WgpuDevice, WgpuInitError>
Expand description

Register an existing setup with an explicitly selected graphics API.

The requested API must match the setup’s backend. With msl enabled, an explicit crate::Metal request requires native MSL support; AutoGraphicsApi permits WGSL fallback. Invalid configuration, unavailable compilers, and registration failures are returned as errors. Register once, then clone the returned device.