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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/// The GL stage name used in a WebGL compile diagnostic.
pub const BACKEND_WEBGL_STAGE_VERTEX: &str = "vertex";
/// The GL stage name used in a WebGL compile diagnostic.
pub const BACKEND_WEBGL_STAGE_FRAGMENT: &str = "fragment";
/// The sampler uniform name of the packed scene texture.
pub const RAYTRACE_GLSL_UNIFORM_SCENE: &str = "u_scene";
/// The sampler uniform name of the packed frame texture.
pub const RAYTRACE_GLSL_UNIFORM_FRAME: &str = "u_frame";
/// The texture-unit index the scene sampler reads.
pub const WEBGL_SAMPLER_UNIT_SCENE: i32 = 0;
/// The texture-unit index the frame sampler reads.
pub const WEBGL_SAMPLER_UNIT_FRAME: i32 = 1;
/// The texels one `vec4` slot occupies in a packed data texture.
pub const WEBGL_PACKED_TEXELS_PER_VEC4: usize = 4;
/// The number of entries `MAX_VIEWPORT_DIMS` reports.
pub const WEBGL_VIEWPORT_AXIS_COUNT: usize = 2;
/// The largest per-axis viewport dimension accepted from a driver, so a
/// context reporting an absurd pair still yields a conservative limit
/// rather than one no surface could ever satisfy.
pub const WEBGL_VIEWPORT_DIMENSION_CEILING: u32 = 65535;
/// The most pending `glGetError` codes one drain reads, so a context
/// that reports errors faster than they clear cannot spin forever.
pub const WEBGL_ERROR_DRAIN_LIMIT: usize = 32;
/// The edge of the smallest texture a context can be asked for, used as
/// the placeholder allocation so a context that never uploads a block
/// still owns a complete, bindable texture.
pub const WEBGL_PLACEHOLDER_TEXELS: i32 = 1;
/// The number of mip levels `texStorage2D` allocates. One level is
/// exactly what a packed data texture needs: it is sampled with
/// `texelFetch` at level zero and never minified, so a mip chain would
/// be pure memory.
pub const WEBGL_MIP_LEVELS_ONE: i32 = 1;
/// The `glGetError` code meaning no error is pending.
pub const WEBGL_ERROR_NO_ERROR: u32 = 0;
/// The `MAX_TEXTURE_SIZE` assumed when the implementation reports no
/// usable value, the smallest bound every WebGL 2 context guarantees.
pub const WEBGL_TEXTURE_SIZE_LIMIT_FALLBACK: u32 = 2048;
/// The per-axis `MAX_VIEWPORT_DIMS` assumed when the implementation
/// reports no usable pair, the bound every WebGL 2 context guarantees.
pub const WEBGL_VIEWPORT_DIMENSION_FALLBACK: u32 = 1024;
/// The `glGetError` name for an illegal enum value.
pub const WEBGL_ERROR_NAME_INVALID_ENUM: &str = "INVALID_ENUM";
/// The `glGetError` name for an out-of-range numeric argument.
pub const WEBGL_ERROR_NAME_INVALID_VALUE: &str = "INVALID_VALUE";
/// The `glGetError` name for an operation illegal in the current state.
pub const WEBGL_ERROR_NAME_INVALID_OPERATION: &str = "INVALID_OPERATION";
/// The `glGetError` name for a failed allocation.
pub const WEBGL_ERROR_NAME_OUT_OF_MEMORY: &str = "OUT_OF_MEMORY";
/// The `glGetError` name for a code this backend has no name for.
pub const WEBGL_ERROR_NAME_UNKNOWN: &str = "an unrecognised code";
/// The call name used when a drain reports an error raised before the
/// call being attributed, so the diagnostic does not blame the wrong one.
pub const WEBGL_ERROR_SOURCE_PENDING: &str = "the pending queue";
/// The call name used when a draw's drain reports an error raised by one
/// of the binding calls that preceded it.
pub const WEBGL_ERROR_SOURCE_BINDING: &str = "the binding state";
/// The error detail written when `createVertexArray` produced nothing.
pub const ERROR_WEBGL_VAO_REJECTED: &str = "createVertexArray returned null";
/// The error detail written when `createProgram` produced nothing.
pub const ERROR_WEBGL_PROGRAM_NULL: &str = "createProgram returned null";
/// The error detail written when `createTexture` produced nothing.
pub const ERROR_WEBGL_TEXTURE_NULL: &str = "createTexture returned null";
/// The error detail written when a packed block exceeds what any shape
/// this context can allocate holds.
pub const ERROR_WEBGL_BLOCK_TOO_LARGE: &str =
"the packed block does not fit a texture this WebGL 2 context can allocate";
/// The error reported when the packed texture write was refused.
pub const ERROR_WEBGL_UPLOAD: &str = "the WebGL 2 packed texture write was refused";
/// The error reported when a packed block carries no slots at all.
pub const ERROR_WEBGL_EMPTY_BLOCK: &str = "the packed block carries no vec4 slots";
/// The error reported when a requested surface dimension exceeds what
/// this context accepts.
pub const ERROR_WEBGL_SURFACE_LIMIT: &str =
"the requested surface dimension exceeds this WebGL 2 context's limit";
/// The error reported when the drawing buffer has no drawable area.
pub const ERROR_WEBGL_EMPTY_DRAWING_BUFFER: &str =
"the WebGL 2 drawing buffer has no drawable area";