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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
use *;
/// Which shader stage a GLSL source is compiled for.
///
/// WebGL identifies a shader by the raw `VERTEX_SHADER` /
/// `FRAGMENT_SHADER` enum rather than by a string, and the same raw
/// `u32` is threaded through the [`GlProgram`] path.
/// This enum names the two stages so a caller cannot pass a meaningless
/// value and have the browser reject the compile later.
/// The completeness verdict a framebuffer reports after its attachments
/// are bound.
///
/// WebGL returns a single `u32` status code rather than an error, so the
/// distinct failure modes a caller must actually react to are lifted
/// into named variants: one means "an attachment is missing", one means
/// "the attachments disagree with each other", and one means "this
/// driver cannot do what you asked for at all".
/// Why a [`WebGl2Backend`] could not be constructed.
///
/// WebGL reports context-creation failure by returning `null` rather than
/// by throwing, so the three ways it fails, a missing canvas, a
/// non-matching selector, and a browser with no WebGL 2 support, would
/// otherwise all collapse into one opaque `None`.
/// Errors that can occur while building a WebGL shader program.
///
/// Each variant carries the browser-provided info log so the caller can
/// surface the exact GLSL diagnostic without losing fidelity.