1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! # `ironaccelerator-webgpu`
//!
//! WebGPU backend for the browser. This is the WASM compute path, and only
//! that: on native targets, Vulkan, Metal, D3D12, and OpenGL reach the same
//! hardware directly, so routing through a portability layer would add a
//! translation step without adding coverage.
//!
//! ## How it works
//!
//! WebGPU adapter negotiation is asynchronous and
//! [`Backend`](ironaccelerator_core::Backend) is not, so this crate does not
//! negotiate. The host awaits `requestAdapter()` / `requestDevice()`, keeps the
//! resulting `GPUDevice`, and describes it once via [`drv::bind_adapter`].
//! From then on the adapter shows up in `Runtime::devices()` alongside every
//! native backend.
//!
//! ```
//! use ironaccelerator_webgpu::drv::{bind_adapter, AdapterInfo};
//!
//! // After `requestDevice()` resolves, from whatever binding layer you use:
//! bind_adapter(AdapterInfo {
//! vendor: "nvidia".into(),
//! architecture: "ampere".into(),
//! shader_f16: true,
//! max_buffer_size: 1 << 28,
//! ..Default::default()
//! });
//! ```
//!
//! ## What it deliberately does not do
//!
//! No buffers, pipelines, or dispatch. Those need a live `GPUDevice`, which
//! stays with the host, and wrapping them would mean re-exporting a binding
//! crate's types through this API — the coupling that made the previous
//! `wgpu`-based version 98 transitive dependencies deep. The host already
//! holds the device and can call WebGPU directly.
//!
//! Consequently this crate has no dependencies beyond
//! [`ironaccelerator-core`](ironaccelerator_core) and compiles for every
//! target, `wasm32-unknown-unknown` included, with no feature flags and no
//! `--cfg` requirements.
pub use ;
pub use ;
/// Register the WebGPU backend into the given registry. Idempotent.
///
/// Registering before [`bind_adapter`] is fine — the backend simply reports
/// unavailable until a host binds one.