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
56
57
58
59
60
61
62
63
64
65
66
67
use *;
/// Maps the WebGPU init state plus the engine's stable error code to
/// the banner text shown next to "Status: ".
///
/// This is the canonical mapping used by both the 2D and 3D WebGPU
/// demo tabs. The function is intentionally pure (no JS bridge calls,
/// no allocations) so the render path can call it every frame.
///
/// Decision tree:
///
/// - `loaded == false`: returns [`WEBGPU_STATUS_INITIALIZING`].
/// - `active == true`: returns [`WEBGPU_STATUS_ACTIVE`].
/// - `navigator.gpu` absent OR engine reports
/// [`WEBGPU_CODE_NAVIGATOR_GPU_MISSING`]: returns
/// [`WEBGPU_STATUS_NEEDS_HTTPS_OR_LOCALHOST`].
/// - adapter missing / timed out ([`WEBGPU_CODE_ADAPTER_UNAVAILABLE`]
/// or [`WEBGPU_CODE_ADAPTER_PROMISE`]): returns
/// [`WEBGPU_STATUS_ADAPTER_UNAVAILABLE`].
/// - device missing / timed out ([`WEBGPU_CODE_DEVICE_UNAVAILABLE`] or
/// [`WEBGPU_CODE_DEVICE_PROMISE`]): returns
/// [`WEBGPU_STATUS_DEVICE_UNAVAILABLE`].
/// - [`WEBGPU_CODE_CANVAS_NOT_FOUND`][] returns
/// [`WEBGPU_STATUS_CANVAS_NOT_FOUND`].
/// - [`WEBGPU_CODE_CANVAS_CONTEXT_UNAVAILABLE`][] returns
/// [`WEBGPU_STATUS_CANVAS_CONTEXT_UNAVAILABLE`].
/// - any code listed in [`WEBGPU_CODE_API_FAILURE`][] returns
/// [`WEBGPU_STATUS_INIT_FAILED_BROWSER_API`].
/// - anything else (empty or unknown code) returns
/// [`WEBGPU_STATUS_NOT_SUPPORTED`].
///
/// # Arguments
///
/// - `bool` - A boolean (`bool`).
/// - `bool` - A boolean (`bool`).
/// - `&str` - Shared reference to a `str`.
///
/// # Returns
///
/// - `'static str` - A `'static str` value.
pub