Expand description
Host-bound WebGPU adapter registration.
WebGPU has no synchronous enumeration. navigator.gpu.requestAdapter() and
GPUAdapter.requestDevice() both return promises, and Backend is a
synchronous trait — so this crate cannot negotiate an adapter itself
without blocking, which is not permitted on a browser’s main thread.
The host therefore does the async negotiation and registers the result with
bind_adapter. Everything downstream — enumerate, the Backend
impl, Runtime::devices() — reads what was bound. Until a host binds, the
backend honestly reports unavailable.
Structs§
- Adapter
Info - What a host learned about its adapter, in WebGPU’s own vocabulary.
Functions§
- bind_
adapter - Register the adapter this host negotiated. Replaces any previous binding.
- bound_
adapter - The currently bound adapter, if any.
- enumerate
- The bound adapter as a one-element list, or empty. WebGPU exposes exactly
one adapter per
requestAdaptercall; there is no multi-device survey. - is_
available - Whether a host has bound an adapter.
- unbind_
adapter - Drop the current binding. After this the backend reports unavailable again.