Skip to main content

init_device

Function init_device 

Source
pub fn init_device(setup: WgpuSetup, options: RuntimeOptions) -> WgpuDevice
Expand description

Create a WgpuDevice on an existing WgpuSetup. Useful when you want to share a device between CubeCL and other wgpu-dependent libraries.

Uses AutoCompiler with WGSL fallback. Use init_device_with_api to request a graphics API explicitly, including native MSL on Metal when msl is enabled.

ยงPanics

If configuration is invalid, the setup is incompatible, or registration fails. Use try_init_device to handle initialization errors. Register each setup once, then clone the returned device to share its runtime; repeated handles are not detected.