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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
pub const WEBGPU_VERTEX_FORMAT_FLOAT32: &str = "float32";
/// The CSS composite operation string for the `Luminosity` blend mode.
pub const BLEND_MODE_LUMINOSITY: &str = "luminosity";
pub const WEBGPU_COMPARE_NOT_EQUAL: &str = "not-equal";
pub const WEBGPU_VERTEX_FORMAT_FLOAT32X4: &str = "float32x4";
/// The bitmask value for `GPUBufferUsage.MAP_WRITE` (`0x02`), the counterpart
/// of [`BufferUsage::MapWrite`].
///
/// Required on any buffer the CPU writes through `mapAsync`.
pub const RENDER_USAGE_MAP_WRITE: f64 = 2.0;
/// The CSS composite operation string for the `Saturation` blend mode.
pub const BLEND_MODE_SATURATION: &str = "saturation";
pub const WEBGPU_BLEND_OPERATION_SUBTRACT: &str = "subtract";
/// Validation-layer error filter; catches shader compile/link errors,
/// bind-group mismatches, OOB draws, etc.
pub const WEBGPU_ERROR_FILTER_VALIDATION: &str = "validation";
pub const WEBGPU_COMPARE_LESS_EQUAL: &str = "less-equal";
/// The CSS composite operation string for the `Hue` blend mode.
pub const BLEND_MODE_HUE: &str = "hue";
/// The CSS composite operation string for the `Exclusion` blend mode.
pub const BLEND_MODE_EXCLUSION: &str = "exclusion";
/// `clamp-to-edge` address mode for U / V / W sampler axes.
pub const WEBGPU_ADDRESS_MODE_CLAMP_TO_EDGE: &str = "clamp-to-edge";
/// The bitmask value for `GPUBufferUsage.UNIFORM` (`0x40`), the counterpart
/// of [`BufferUsage::Uniform`].
///
/// Required on any buffer bound as `var<uniform>` in WGSL.
pub const RENDER_USAGE_UNIFORM: f64 = 64.0;
/// The CSS composite operation string for the `Lighten` blend mode.
pub const BLEND_MODE_LIGHTEN: &str = "lighten";
pub const WEBGPU_INDEX_FORMAT_UINT16: &str = "uint16";
/// The WebGPU `clear` load operation string.
pub const WEBGPU_LOAD_OP_CLEAR: &str = "clear";
pub const WEBGPU_BLEND_FACTOR_DST: &str = "dst";
pub const WEBGPU_VERTEX_FORMAT_SINT32: &str = "sint32";
pub const WEBGPU_BLEND_FACTOR_ONE: &str = "one";
/// The CSS composite operation string for the `HardLight` blend mode.
pub const BLEND_MODE_HARD_LIGHT: &str = "hard-light";
/// The bitmask value for `GPUTextureUsage.COPY_SRC` (`0x01`), the counterpart
/// of [`TextureUsage::CopySource`].
///
/// Deliberately distinct from [`RENDER_USAGE_COPY_SRC`], which is the
/// *buffer* bit (`0x04`): the two namespaces share their variant names
/// but not their values, which is why they get their own constants
/// rather than sharing one.
pub const RENDER_TEXTURE_USAGE_COPY_SRC: f64 = 1.0;
/// The CSS composite operation string for the `SoftLight` blend mode.
pub const BLEND_MODE_SOFT_LIGHT: &str = "soft-light";
/// The bitmask value for `GPUBufferUsage.COPY_DST` (`0x08`), the counterpart
/// of [`BufferUsage::CopyDestination`].
///
/// Required on any buffer that is the destination of a copy or of
/// `queue.writeBuffer`.
pub const RENDER_USAGE_COPY_DST: f64 = 8.0;
pub const WEBGPU_BLEND_FACTOR_ONE_MINUS_SRC: &str = "one-minus-src";
/// `textureSampleCompare` comparison function: keep fragments closer to
/// the camera than the reference depth.
pub const WEBGPU_COMPARE_LESS: &str = "less";
pub const WEBGPU_BLEND_FACTOR_SRC: &str = "src";
pub const WEBGPU_INDEX_FORMAT_UINT32: &str = "uint32";
pub const WEBGPU_CULL_MODE_FRONT: &str = "front";
/// The bitmask value for `GPUBufferUsage.VERTEX` (`0x08`), the counterpart
/// of [`BufferUsage::Vertex`].
///
/// Required on any buffer handed to `setVertexBuffer`.
pub const RENDER_USAGE_VERTEX: f64 = 32.0;
/// The bitmask value for `GPUBufferUsage.MAP_READ` (`0x01`), the counterpart
/// of [`BufferUsage::MapRead`].
///
/// Required on any buffer the CPU reads through `mapAsync`.
pub const RENDER_USAGE_MAP_READ: f64 = 1.0;
pub const WEBGPU_VERTEX_FORMAT_UINT32: &str = "uint32";
pub const WEBGPU_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP: &str = "triangle-strip";
pub const WEBGPU_COMPARE_EQUAL: &str = "equal";
pub const WEBGPU_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA: &str = "one-minus-src-alpha";
pub const WEBGPU_BLEND_OPERATION_MAX: &str = "max";
/// 24-bit depth, 8-bit stencil, no multisample. The most common choice
/// for a render pass's depth-stencil attachment.
pub const WEBGPU_DEPTH_FORMAT_DEPTH24_PLUS_STENCIL8: &str = "depth24plus-stencil8";
/// The CSS composite operation string for the `ColorBurn` blend mode.
pub const BLEND_MODE_COLOR_BURN: &str = "color-burn";
/// The bitmask value for `GPUTextureUsage.RENDER_ATTACHMENT` (`0x10`), the counterpart
/// of [`TextureUsage::RenderAttachment`].
///
/// Required on any texture used as an attachment of a render pass.
pub const RENDER_USAGE_RENDER_ATTACHMENT: f64 = 16.0;
pub const WEBGPU_BLEND_FACTOR_DST_ALPHA: &str = "dst-alpha";
pub const WEBGPU_FORMAT_BGRA8UNORM: &str = "bgra8unorm";
/// The bitmask value for `GPUBufferUsage.STORAGE` (`0x80`), the counterpart
/// of [`BufferUsage::Storage`].
///
/// Required on any buffer bound as `var<storage>` in WGSL.
pub const RENDER_USAGE_STORAGE: f64 = 128.0;
/// The CSS composite operation string for the `Difference` blend mode.
pub const BLEND_MODE_DIFFERENCE: &str = "difference";
pub const WEBGPU_BLEND_FACTOR_CONSTANT_ALPHA: &str = "constant-alpha";
pub const WEBGPU_PRIMITIVE_TOPOLOGY_LINE_LIST: &str = "line-list";
/// 24-bit depth (no stencil) without MSAA. The default for shadow maps
/// and other single-sample depth render targets.
pub const WEBGPU_DEPTH_FORMAT_DEPTH24_PLUS: &str = "depth24plus";
/// The CSS composite operation string for the `Darken` blend mode.
pub const BLEND_MODE_DARKEN: &str = "darken";
pub const WEBGPU_BLEND_OPERATION_MIN: &str = "min";
/// The bitmask value for `GPUBufferUsage.INDIRECT` (`0x100`), the counterpart
/// of [`BufferUsage::Indirect`].
///
/// Required on any buffer supplying the arguments of an indirect draw or
/// dispatch.
pub const RENDER_USAGE_INDIRECT: f64 = 256.0;
pub const WEBGPU_CULL_MODE_BACK: &str = "back";
pub const WEBGPU_ADDRESS_MODE_REPEAT: &str = "repeat";
/// The WebGPU primitive topology string for triangle lists.
pub const WEBGPU_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST: &str = "triangle-list";
/// The CSS composite operation string for the `Lighter` blend mode.
pub const BLEND_MODE_LIGHTER: &str = "lighter";
/// The bitmask value for `GPUShaderStage.FRAGMENT` (`0x02`), the counterpart
/// of [`ShaderStage::Fragment`].
pub const SHADER_STAGE_FRAGMENT: f64 = 2.0;
pub const WEBGPU_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA: &str = "one-minus-constant-alpha";
/// `loadOp` / `depthLoadOp` value that preserves the previous contents
/// of the attachment.
pub const WEBGPU_LOAD_OP_LOAD: &str = "load";
pub const WEBGPU_FRONT_FACE_COUNTER_CLOCKWISE: &str = "ccw";
/// Minification / magnification filter mode that picks the nearest texel.
pub const WEBGPU_FILTER_MODE_NEAREST: &str = "nearest";
pub const WEBGPU_VERTEX_FORMAT_FLOAT32X3: &str = "float32x3";
pub const WEBGPU_BLEND_FACTOR_ONE_MINUS_DST_ALPHA: &str = "one-minus-dst-alpha";
pub const WEBGPU_COMPARE_NEVER: &str = "never";
pub const WEBGPU_COMPARE_GREATER_EQUAL: &str = "greater-equal";
pub const WEBGPU_PRIMITIVE_TOPOLOGY_POINT_LIST: &str = "point-list";
pub const WEBGPU_BLEND_FACTOR_ZERO: &str = "zero";
pub const WEBGPU_BLEND_OPERATION_REVERSE_SUBTRACT: &str = "reverse-subtract";
/// The bitmask value for `GPUTextureUsage.TEXTURE_BINDING` (`0x04`), the counterpart
/// of [`TextureUsage::TextureBinding`].
///
/// Required on any texture sampled through a `texture_2d` binding.
pub const RENDER_USAGE_TEXTURE_BINDING: f64 = 4.0;
/// 32-bit float depth, no stencil. Required for view-space z-buffers
/// used in deferred renderers.
pub const WEBGPU_DEPTH_FORMAT_DEPTH32_FLOAT: &str = "depth32float";
pub const WEBGPU_ADDRESS_MODE_MIRROR_REPEAT: &str = "mirror-repeat";
/// The bitmask value for `GPUShaderStage.VERTEX` (`0x01`), the counterpart
/// of [`ShaderStage::Vertex`].
pub const SHADER_STAGE_VERTEX: f64 = 1.0;
pub const WEBGPU_BLEND_FACTOR_SRC_ALPHA_SATURATED: &str = "src-alpha-saturated";
/// The CSS composite operation string for the `ColorDodge` blend mode.
pub const BLEND_MODE_COLOR_DODGE: &str = "color-dodge";
pub const WEBGPU_PRIMITIVE_TOPOLOGY_LINE_STRIP: &str = "line-strip";
pub const WEBGPU_VERTEX_FORMAT_UNORM8X4: &str = "unorm8x4";
/// The bitmask value for `GPUTextureUsage.COPY_DST` (`0x02`), the counterpart
/// of [`TextureUsage::CopyDestination`].
///
/// Deliberately distinct from [`RENDER_USAGE_COPY_DST`], which is the
/// *buffer* bit (`0x08`).
pub const RENDER_TEXTURE_USAGE_COPY_DST: f64 = 2.0;
pub const WEBGPU_BLEND_FACTOR_CONSTANT: &str = "constant";
/// The bitmask value for `GPUShaderStage.COMPUTE` (`0x04`), the counterpart
/// of [`ShaderStage::Compute`].
pub const SHADER_STAGE_COMPUTE: f64 = 4.0;
pub const WEBGPU_FORMAT_RGBA8UNORM: &str = "rgba8unorm";
/// The bitmask value for `GPUBufferUsage.INDEX` (`0x04`), the counterpart
/// of [`BufferUsage::Index`].
///
/// Required on any buffer handed to `setIndexBuffer` and consumed by
/// `drawIndexed`.
pub const RENDER_USAGE_INDEX: f64 = 16.0;
pub const WEBGPU_ERROR_FILTER_OUT_OF_MEMORY: &str = "out-of-memory";
/// The bitmask value for `GPUBufferUsage.COPY_SRC` (`0x01`), the counterpart
/// of [`BufferUsage::CopySource`].
///
/// Required on any buffer that is the source of a copy.
pub const RENDER_USAGE_COPY_SRC: f64 = 4.0;
/// The CSS composite operation string for the `Multiply` blend mode.
pub const BLEND_MODE_MULTIPLY: &str = "multiply";
pub const WEBGPU_FILTER_MODE_LINEAR: &str = "linear";
/// The bitmask value for `GPUBufferUsage.QUERY_RESOLVE` (`0x200`), the counterpart
/// of [`BufferUsage::QueryResolve`].
///
/// Required on the destination buffer of `resolveQuerySet`.
pub const RENDER_USAGE_QUERY_RESOLVE: f64 = 512.0;
pub const WEBGPU_COMPARE_GREATER: &str = "greater";
pub const WEBGPU_FORMAT_RGBA32FLOAT: &str = "rgba32float";
pub const WEBGPU_BLEND_FACTOR_ONE_MINUS_DST: &str = "one-minus-dst";
/// The CSS composite operation string for the `Normal` blend mode.
pub const BLEND_MODE_NORMAL: &str = "source-over";
pub const WEBGPU_BLEND_FACTOR_SRC_ALPHA: &str = "src-alpha";
pub const WEBGPU_FORMAT_R32FLOAT: &str = "r32float";
/// `storeOp` value that discards the result (saves bandwidth when we
/// will not read it back, e.g. the depth buffer at the end of a pass).
pub const WEBGPU_STORE_OP_DISCARD: &str = "discard";
/// The bitmask value for `GPUTextureUsage.STORAGE_BINDING` (`0x10`), the counterpart
/// of [`TextureUsage::StorageBinding`].
///
/// Required on any texture bound as a `texture_storage_2d` in WGSL.
pub const RENDER_USAGE_STORAGE_BINDING: f64 = 8.0;
pub const WEBGPU_FORMAT_RGBA16FLOAT: &str = "rgba16float";
pub const WEBGPU_VERTEX_FORMAT_FLOAT32X2: &str = "float32x2";
pub const WEBGPU_CULL_MODE_NONE: &str = "none";
pub const WEBGPU_COMPARE_ALWAYS: &str = "always";
pub const WEBGPU_BLEND_FACTOR_ONE_MINUS_CONSTANT: &str = "one-minus-constant";
pub const WEBGPU_ERROR_FILTER_INTERNAL: &str = "internal";
pub const WEBGPU_FRONT_FACE_CLOCKWISE: &str = "cw";
/// The WebGPU `store` store operation string.
pub const WEBGPU_STORE_OP_STORE: &str = "store";
pub const WEBGPU_BLEND_OPERATION_ADD: &str = "add";
/// The CSS composite operation string for the `Color` blend mode.
pub const BLEND_MODE_COLOR: &str = "color";
/// The CSS composite operation string for the `Screen` blend mode.
pub const BLEND_MODE_SCREEN: &str = "screen";
/// The CSS composite operation string for the `Overlay` blend mode.
pub const BLEND_MODE_OVERLAY: &str = "overlay";
/// 2D view dimension (the default for `GpuTexture.createView`).
pub const WEBGPU_TEXTURE_VIEW_DIMENSION_2D: &str = "2d";
/// The `GPUVertexStepMode.VERTEX` string, the counterpart of
/// [`VertexStepMode::Vertex`].
pub const WEBGPU_VERTEX_STEP_MODE_VERTEX: &str = "vertex";
/// The `GPUVertexStepMode.INSTANCE` string, the counterpart of
/// [`VertexStepMode::Instance`].
pub const WEBGPU_VERTEX_STEP_MODE_INSTANCE: &str = "instance";