@wasi-gfx/js-webgpu 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +26 -0
  2. package/dist/index.js +1665 -0
  3. package/package.json +35 -0
  4. package/types/interfaces/wasi-cli-run.d.ts +5 -0
  5. package/types/interfaces/wasi-cli-stdout.d.ts +3 -0
  6. package/types/interfaces/wasi-frame-buffer-frame-buffer.d.ts +21 -0
  7. package/types/interfaces/wasi-graphics-context-graphics-context.d.ts +17 -0
  8. package/types/interfaces/wasi-io-error.d.ts +18 -0
  9. package/types/interfaces/wasi-io-poll.d.ts +43 -0
  10. package/types/interfaces/wasi-io-streams.d.ts +240 -0
  11. package/types/interfaces/wasi-surface-surface.d.ts +400 -0
  12. package/types/interfaces/wasi-webgpu-webgpu.d.ts +1636 -0
  13. package/types/wit.d.ts +10 -0
  14. package/wit/deps/cli/command.wit +7 -0
  15. package/wit/deps/cli/environment.wit +18 -0
  16. package/wit/deps/cli/exit.wit +4 -0
  17. package/wit/deps/cli/imports.wit +20 -0
  18. package/wit/deps/cli/run.wit +4 -0
  19. package/wit/deps/cli/stdio.wit +17 -0
  20. package/wit/deps/cli/terminal.wit +49 -0
  21. package/wit/deps/clocks/monotonic-clock.wit +45 -0
  22. package/wit/deps/clocks/wall-clock.wit +42 -0
  23. package/wit/deps/clocks/world.wit +6 -0
  24. package/wit/deps/filesystem/preopens.wit +8 -0
  25. package/wit/deps/filesystem/types.wit +634 -0
  26. package/wit/deps/filesystem/world.wit +6 -0
  27. package/wit/deps/frame-buffer/frame-buffer.wit +23 -0
  28. package/wit/deps/graphics-context/graphics-context.wit +18 -0
  29. package/wit/deps/io/error.wit +34 -0
  30. package/wit/deps/io/poll.wit +41 -0
  31. package/wit/deps/io/streams.wit +262 -0
  32. package/wit/deps/io/world.wit +6 -0
  33. package/wit/deps/random/insecure-seed.wit +25 -0
  34. package/wit/deps/random/insecure.wit +22 -0
  35. package/wit/deps/random/random.wit +26 -0
  36. package/wit/deps/random/world.wit +7 -0
  37. package/wit/deps/sockets/instance-network.wit +9 -0
  38. package/wit/deps/sockets/ip-name-lookup.wit +51 -0
  39. package/wit/deps/sockets/network.wit +145 -0
  40. package/wit/deps/sockets/tcp-create-socket.wit +27 -0
  41. package/wit/deps/sockets/tcp.wit +353 -0
  42. package/wit/deps/sockets/udp-create-socket.wit +27 -0
  43. package/wit/deps/sockets/udp.wit +266 -0
  44. package/wit/deps/sockets/world.wit +11 -0
  45. package/wit/deps/surface/surface.wit +248 -0
  46. package/wit/deps/webgpu/imports.wit +5 -0
  47. package/wit/deps/webgpu/webgpu.wit +1085 -0
  48. package/wit/deps.lock +51 -0
  49. package/wit/deps.toml +18 -0
  50. package/wit/world.wit +10 -0
@@ -0,0 +1,1085 @@
1
+ package wasi:webgpu@0.0.1;
2
+
3
+ interface webgpu {
4
+ use wasi:io/poll@0.2.0.{ pollable };
5
+ use wasi:graphics-context/graphics-context@0.0.1.{ context, abstract-buffer };
6
+ resource gpu-supported-limits {
7
+ max-texture-dimension1-d: func() -> u32;
8
+ max-texture-dimension2-d: func() -> u32;
9
+ max-texture-dimension3-d: func() -> u32;
10
+ max-texture-array-layers: func() -> u32;
11
+ max-bind-groups: func() -> u32;
12
+ max-bind-groups-plus-vertex-buffers: func() -> u32;
13
+ max-bindings-per-bind-group: func() -> u32;
14
+ max-dynamic-uniform-buffers-per-pipeline-layout: func() -> u32;
15
+ max-dynamic-storage-buffers-per-pipeline-layout: func() -> u32;
16
+ max-sampled-textures-per-shader-stage: func() -> u32;
17
+ max-samplers-per-shader-stage: func() -> u32;
18
+ max-storage-buffers-per-shader-stage: func() -> u32;
19
+ max-storage-textures-per-shader-stage: func() -> u32;
20
+ max-uniform-buffers-per-shader-stage: func() -> u32;
21
+ max-uniform-buffer-binding-size: func() -> u64;
22
+ max-storage-buffer-binding-size: func() -> u64;
23
+ min-uniform-buffer-offset-alignment: func() -> u32;
24
+ min-storage-buffer-offset-alignment: func() -> u32;
25
+ max-vertex-buffers: func() -> u32;
26
+ max-buffer-size: func() -> u64;
27
+ max-vertex-attributes: func() -> u32;
28
+ max-vertex-buffer-array-stride: func() -> u32;
29
+ max-inter-stage-shader-variables: func() -> u32;
30
+ max-color-attachments: func() -> u32;
31
+ max-color-attachment-bytes-per-sample: func() -> u32;
32
+ max-compute-workgroup-storage-size: func() -> u32;
33
+ max-compute-invocations-per-workgroup: func() -> u32;
34
+ max-compute-workgroup-size-x: func() -> u32;
35
+ max-compute-workgroup-size-y: func() -> u32;
36
+ max-compute-workgroup-size-z: func() -> u32;
37
+ max-compute-workgroups-per-dimension: func() -> u32;
38
+ }
39
+ resource gpu-supported-features {
40
+ has: func(value: string) -> bool;
41
+ }
42
+ resource wgsl-language-features {
43
+ has: func(value: string) -> bool;
44
+ }
45
+ resource gpu-adapter-info {
46
+ vendor: func() -> string;
47
+ architecture: func() -> string;
48
+ device: func() -> string;
49
+ description: func() -> string;
50
+ subgroup-min-size: func() -> u32;
51
+ subgroup-max-size: func() -> u32;
52
+ }
53
+ resource gpu {
54
+ request-adapter: func(options: option<gpu-request-adapter-options>) -> option<gpu-adapter>;
55
+ get-preferred-canvas-format: func() -> gpu-texture-format;
56
+ wgsl-language-features: func() -> wgsl-language-features;
57
+ }
58
+ enum gpu-power-preference {
59
+ low-power,
60
+ high-performance,
61
+ }
62
+ record gpu-request-adapter-options {
63
+ feature-level: option<string>,
64
+ power-preference: option<gpu-power-preference>,
65
+ force-fallback-adapter: option<bool>,
66
+ xr-compatible: option<bool>,
67
+ }
68
+ resource gpu-adapter {
69
+ features: func() -> gpu-supported-features;
70
+ limits: func() -> gpu-supported-limits;
71
+ info: func() -> gpu-adapter-info;
72
+ is-fallback-adapter: func() -> bool;
73
+ request-device: func(descriptor: option<gpu-device-descriptor>) -> result<gpu-device, request-device-error>;
74
+ }
75
+ resource record-option-gpu-size64 {
76
+ constructor();
77
+ add: func(key: string, value: option<gpu-size64>);
78
+ get: func(key: string) -> option<option<gpu-size64>>;
79
+ has: func(key: string) -> bool;
80
+ remove: func(key: string);
81
+ keys: func() -> list<string>;
82
+ values: func() -> list<option<gpu-size64>>;
83
+ entries: func() -> list<tuple<string, option<gpu-size64>>>;
84
+ }
85
+ enum gpu-feature-name {
86
+ depth-clip-control,
87
+ depth32float-stencil8,
88
+ texture-compression-bc,
89
+ texture-compression-bc-sliced3d,
90
+ texture-compression-etc2,
91
+ texture-compression-astc,
92
+ texture-compression-astc-sliced3d,
93
+ timestamp-query,
94
+ indirect-first-instance,
95
+ shader-f16,
96
+ rg11b10ufloat-renderable,
97
+ bgra8unorm-storage,
98
+ float32-filterable,
99
+ float32-blendable,
100
+ clip-distances,
101
+ dual-source-blending,
102
+ subgroups,
103
+ }
104
+ resource gpu-device {
105
+ features: func() -> gpu-supported-features;
106
+ limits: func() -> gpu-supported-limits;
107
+ adapter-info: func() -> gpu-adapter-info;
108
+ queue: func() -> gpu-queue;
109
+ destroy: func();
110
+ create-buffer: func(descriptor: gpu-buffer-descriptor) -> gpu-buffer;
111
+ create-texture: func(descriptor: gpu-texture-descriptor) -> gpu-texture;
112
+ create-sampler: func(descriptor: option<gpu-sampler-descriptor>) -> gpu-sampler;
113
+ create-bind-group-layout: func(descriptor: gpu-bind-group-layout-descriptor) -> gpu-bind-group-layout;
114
+ create-pipeline-layout: func(descriptor: gpu-pipeline-layout-descriptor) -> gpu-pipeline-layout;
115
+ create-bind-group: func(descriptor: gpu-bind-group-descriptor) -> gpu-bind-group;
116
+ create-shader-module: func(descriptor: gpu-shader-module-descriptor) -> gpu-shader-module;
117
+ create-compute-pipeline: func(descriptor: gpu-compute-pipeline-descriptor) -> gpu-compute-pipeline;
118
+ create-render-pipeline: func(descriptor: gpu-render-pipeline-descriptor) -> gpu-render-pipeline;
119
+ create-compute-pipeline-async: func(descriptor: gpu-compute-pipeline-descriptor) -> result<gpu-compute-pipeline, create-pipeline-error>;
120
+ create-render-pipeline-async: func(descriptor: gpu-render-pipeline-descriptor) -> result<gpu-render-pipeline, create-pipeline-error>;
121
+ create-command-encoder: func(descriptor: option<gpu-command-encoder-descriptor>) -> gpu-command-encoder;
122
+ create-render-bundle-encoder: func(descriptor: gpu-render-bundle-encoder-descriptor) -> gpu-render-bundle-encoder;
123
+ create-query-set: func(descriptor: gpu-query-set-descriptor) -> result<gpu-query-set, create-query-set-error>;
124
+ label: func() -> string;
125
+ set-label: func(label: string);
126
+ lost: func() -> gpu-device-lost-info;
127
+ push-error-scope: func(filter: gpu-error-filter);
128
+ pop-error-scope: func() -> result<option<gpu-error>, pop-error-scope-error>;
129
+ onuncapturederror-subscribe: func() -> pollable;
130
+ connect-graphics-context: func(context: borrow<context>);
131
+ }
132
+ resource gpu-buffer {
133
+ size: func() -> gpu-size64-out;
134
+ usage: func() -> gpu-flags-constant;
135
+ map-state: func() -> gpu-buffer-map-state;
136
+ map-async: func(mode: gpu-map-mode-flags, offset: option<gpu-size64>, size: option<gpu-size64>) -> result<_, map-async-error>;
137
+ get-mapped-range-get-with-copy: func(offset: option<gpu-size64>, size: option<gpu-size64>) -> result<list<u8>, get-mapped-range-error>;
138
+ unmap: func() -> result<_, unmap-error>;
139
+ destroy: func();
140
+ label: func() -> string;
141
+ set-label: func(label: string);
142
+ get-mapped-range-set-with-copy: func(data: list<u8>, offset: option<gpu-size64>, size: option<gpu-size64>) -> result<_, get-mapped-range-error>;
143
+ }
144
+ enum gpu-buffer-map-state {
145
+ unmapped,
146
+ pending,
147
+ mapped,
148
+ }
149
+ type gpu-buffer-usage-flags = u32;
150
+ resource gpu-buffer-usage {
151
+ MAP-READ: static func() -> gpu-flags-constant;
152
+ MAP-WRITE: static func() -> gpu-flags-constant;
153
+ COPY-SRC: static func() -> gpu-flags-constant;
154
+ COPY-DST: static func() -> gpu-flags-constant;
155
+ INDEX: static func() -> gpu-flags-constant;
156
+ VERTEX: static func() -> gpu-flags-constant;
157
+ UNIFORM: static func() -> gpu-flags-constant;
158
+ STORAGE: static func() -> gpu-flags-constant;
159
+ INDIRECT: static func() -> gpu-flags-constant;
160
+ QUERY-RESOLVE: static func() -> gpu-flags-constant;
161
+ }
162
+ type gpu-map-mode-flags = u32;
163
+ resource gpu-map-mode {
164
+ READ: static func() -> gpu-flags-constant;
165
+ WRITE: static func() -> gpu-flags-constant;
166
+ }
167
+ resource gpu-texture {
168
+ create-view: func(descriptor: option<gpu-texture-view-descriptor>) -> gpu-texture-view;
169
+ destroy: func();
170
+ width: func() -> gpu-integer-coordinate-out;
171
+ height: func() -> gpu-integer-coordinate-out;
172
+ depth-or-array-layers: func() -> gpu-integer-coordinate-out;
173
+ mip-level-count: func() -> gpu-integer-coordinate-out;
174
+ sample-count: func() -> gpu-size32-out;
175
+ dimension: func() -> gpu-texture-dimension;
176
+ format: func() -> gpu-texture-format;
177
+ usage: func() -> gpu-flags-constant;
178
+ label: func() -> string;
179
+ set-label: func(label: string);
180
+ from-graphics-buffer: static func(buffer: abstract-buffer) -> gpu-texture;
181
+ }
182
+ enum gpu-texture-dimension {
183
+ d1,
184
+ d2,
185
+ d3,
186
+ }
187
+ type gpu-texture-usage-flags = u32;
188
+ resource gpu-texture-usage {
189
+ COPY-SRC: static func() -> gpu-flags-constant;
190
+ COPY-DST: static func() -> gpu-flags-constant;
191
+ TEXTURE-BINDING: static func() -> gpu-flags-constant;
192
+ STORAGE-BINDING: static func() -> gpu-flags-constant;
193
+ RENDER-ATTACHMENT: static func() -> gpu-flags-constant;
194
+ }
195
+ resource gpu-texture-view {
196
+ label: func() -> string;
197
+ set-label: func(label: string);
198
+ }
199
+ enum gpu-texture-view-dimension {
200
+ d1,
201
+ d2,
202
+ d2-array,
203
+ cube,
204
+ cube-array,
205
+ d3,
206
+ }
207
+ enum gpu-texture-aspect {
208
+ all,
209
+ stencil-only,
210
+ depth-only,
211
+ }
212
+ enum gpu-texture-format {
213
+ r8unorm,
214
+ r8snorm,
215
+ r8uint,
216
+ r8sint,
217
+ r16uint,
218
+ r16sint,
219
+ r16float,
220
+ rg8unorm,
221
+ rg8snorm,
222
+ rg8uint,
223
+ rg8sint,
224
+ r32uint,
225
+ r32sint,
226
+ r32float,
227
+ rg16uint,
228
+ rg16sint,
229
+ rg16float,
230
+ rgba8unorm,
231
+ rgba8unorm-srgb,
232
+ rgba8snorm,
233
+ rgba8uint,
234
+ rgba8sint,
235
+ bgra8unorm,
236
+ bgra8unorm-srgb,
237
+ rgb9e5ufloat,
238
+ rgb10a2uint,
239
+ rgb10a2unorm,
240
+ rg11b10ufloat,
241
+ rg32uint,
242
+ rg32sint,
243
+ rg32float,
244
+ rgba16uint,
245
+ rgba16sint,
246
+ rgba16float,
247
+ rgba32uint,
248
+ rgba32sint,
249
+ rgba32float,
250
+ stencil8,
251
+ depth16unorm,
252
+ depth24plus,
253
+ depth24plus-stencil8,
254
+ depth32float,
255
+ depth32float-stencil8,
256
+ bc1-rgba-unorm,
257
+ bc1-rgba-unorm-srgb,
258
+ bc2-rgba-unorm,
259
+ bc2-rgba-unorm-srgb,
260
+ bc3-rgba-unorm,
261
+ bc3-rgba-unorm-srgb,
262
+ bc4-r-unorm,
263
+ bc4-r-snorm,
264
+ bc5-rg-unorm,
265
+ bc5-rg-snorm,
266
+ bc6h-rgb-ufloat,
267
+ bc6h-rgb-float,
268
+ bc7-rgba-unorm,
269
+ bc7-rgba-unorm-srgb,
270
+ etc2-rgb8unorm,
271
+ etc2-rgb8unorm-srgb,
272
+ etc2-rgb8a1unorm,
273
+ etc2-rgb8a1unorm-srgb,
274
+ etc2-rgba8unorm,
275
+ etc2-rgba8unorm-srgb,
276
+ eac-r11unorm,
277
+ eac-r11snorm,
278
+ eac-rg11unorm,
279
+ eac-rg11snorm,
280
+ astc4x4-unorm,
281
+ astc4x4-unorm-srgb,
282
+ astc5x4-unorm,
283
+ astc5x4-unorm-srgb,
284
+ astc5x5-unorm,
285
+ astc5x5-unorm-srgb,
286
+ astc6x5-unorm,
287
+ astc6x5-unorm-srgb,
288
+ astc6x6-unorm,
289
+ astc6x6-unorm-srgb,
290
+ astc8x5-unorm,
291
+ astc8x5-unorm-srgb,
292
+ astc8x6-unorm,
293
+ astc8x6-unorm-srgb,
294
+ astc8x8-unorm,
295
+ astc8x8-unorm-srgb,
296
+ astc10x5-unorm,
297
+ astc10x5-unorm-srgb,
298
+ astc10x6-unorm,
299
+ astc10x6-unorm-srgb,
300
+ astc10x8-unorm,
301
+ astc10x8-unorm-srgb,
302
+ astc10x10-unorm,
303
+ astc10x10-unorm-srgb,
304
+ astc12x10-unorm,
305
+ astc12x10-unorm-srgb,
306
+ astc12x12-unorm,
307
+ astc12x12-unorm-srgb,
308
+ }
309
+ resource gpu-sampler {
310
+ label: func() -> string;
311
+ set-label: func(label: string);
312
+ }
313
+ enum gpu-address-mode {
314
+ clamp-to-edge,
315
+ repeat,
316
+ mirror-repeat,
317
+ }
318
+ enum gpu-filter-mode {
319
+ nearest,
320
+ linear,
321
+ }
322
+ enum gpu-mipmap-filter-mode {
323
+ nearest,
324
+ linear,
325
+ }
326
+ enum gpu-compare-function {
327
+ never,
328
+ less,
329
+ equal,
330
+ less-equal,
331
+ greater,
332
+ not-equal,
333
+ greater-equal,
334
+ always,
335
+ }
336
+ record gpu-sampler-descriptor {
337
+ address-mode-u: option<gpu-address-mode>,
338
+ address-mode-v: option<gpu-address-mode>,
339
+ address-mode-w: option<gpu-address-mode>,
340
+ mag-filter: option<gpu-filter-mode>,
341
+ min-filter: option<gpu-filter-mode>,
342
+ mipmap-filter: option<gpu-mipmap-filter-mode>,
343
+ lod-min-clamp: option<f32>,
344
+ lod-max-clamp: option<f32>,
345
+ compare: option<gpu-compare-function>,
346
+ max-anisotropy: option<u16>,
347
+ label: option<string>,
348
+ }
349
+ resource gpu-bind-group-layout {
350
+ label: func() -> string;
351
+ set-label: func(label: string);
352
+ }
353
+ type gpu-shader-stage-flags = u32;
354
+ resource gpu-shader-stage {
355
+ VERTEX: static func() -> gpu-flags-constant;
356
+ FRAGMENT: static func() -> gpu-flags-constant;
357
+ COMPUTE: static func() -> gpu-flags-constant;
358
+ }
359
+ enum gpu-buffer-binding-type {
360
+ uniform,
361
+ storage,
362
+ read-only-storage,
363
+ }
364
+ enum gpu-sampler-binding-type {
365
+ filtering,
366
+ non-filtering,
367
+ comparison,
368
+ }
369
+ record gpu-sampler-binding-layout {
370
+ %type: option<gpu-sampler-binding-type>,
371
+ }
372
+ enum gpu-texture-sample-type {
373
+ float,
374
+ unfilterable-float,
375
+ depth,
376
+ sint,
377
+ uint,
378
+ }
379
+ record gpu-texture-binding-layout {
380
+ sample-type: option<gpu-texture-sample-type>,
381
+ view-dimension: option<gpu-texture-view-dimension>,
382
+ multisampled: option<bool>,
383
+ }
384
+ enum gpu-storage-texture-access {
385
+ write-only,
386
+ read-only,
387
+ read-write,
388
+ }
389
+ record gpu-storage-texture-binding-layout {
390
+ access: option<gpu-storage-texture-access>,
391
+ format: gpu-texture-format,
392
+ view-dimension: option<gpu-texture-view-dimension>,
393
+ }
394
+ resource gpu-bind-group {
395
+ label: func() -> string;
396
+ set-label: func(label: string);
397
+ }
398
+ resource gpu-pipeline-layout {
399
+ label: func() -> string;
400
+ set-label: func(label: string);
401
+ }
402
+ record gpu-pipeline-layout-descriptor {
403
+ bind-group-layouts: list<option<borrow<gpu-bind-group-layout>>>,
404
+ label: option<string>,
405
+ }
406
+ resource gpu-shader-module {
407
+ get-compilation-info: func() -> gpu-compilation-info;
408
+ label: func() -> string;
409
+ set-label: func(label: string);
410
+ }
411
+ enum gpu-compilation-message-type {
412
+ error,
413
+ warning,
414
+ info,
415
+ }
416
+ resource gpu-compilation-message {
417
+ message: func() -> string;
418
+ %type: func() -> gpu-compilation-message-type;
419
+ line-num: func() -> u64;
420
+ line-pos: func() -> u64;
421
+ offset: func() -> u64;
422
+ length: func() -> u64;
423
+ }
424
+ resource gpu-compilation-info {
425
+ messages: func() -> list<gpu-compilation-message>;
426
+ }
427
+ enum gpu-pipeline-error-reason {
428
+ validation,
429
+ internal,
430
+ }
431
+ variant gpu-layout-mode {
432
+ specific(borrow<gpu-pipeline-layout>),
433
+ auto,
434
+ }
435
+ record gpu-shader-module-compilation-hint {
436
+ entry-point: string,
437
+ layout: option<gpu-layout-mode>,
438
+ }
439
+ record gpu-shader-module-descriptor {
440
+ code: string,
441
+ compilation-hints: option<list<gpu-shader-module-compilation-hint>>,
442
+ label: option<string>,
443
+ }
444
+ resource record-gpu-pipeline-constant-value {
445
+ constructor();
446
+ add: func(key: string, value: gpu-pipeline-constant-value);
447
+ get: func(key: string) -> option<gpu-pipeline-constant-value>;
448
+ has: func(key: string) -> bool;
449
+ remove: func(key: string);
450
+ keys: func() -> list<string>;
451
+ values: func() -> list<gpu-pipeline-constant-value>;
452
+ entries: func() -> list<tuple<string, gpu-pipeline-constant-value>>;
453
+ }
454
+ record gpu-programmable-stage {
455
+ module: borrow<gpu-shader-module>,
456
+ entry-point: option<string>,
457
+ constants: option<record-gpu-pipeline-constant-value>,
458
+ }
459
+ type gpu-pipeline-constant-value = f64;
460
+ resource gpu-compute-pipeline {
461
+ label: func() -> string;
462
+ set-label: func(label: string);
463
+ get-bind-group-layout: func(index: u32) -> gpu-bind-group-layout;
464
+ }
465
+ record gpu-compute-pipeline-descriptor {
466
+ compute: gpu-programmable-stage,
467
+ layout: gpu-layout-mode,
468
+ label: option<string>,
469
+ }
470
+ resource gpu-render-pipeline {
471
+ label: func() -> string;
472
+ set-label: func(label: string);
473
+ get-bind-group-layout: func(index: u32) -> gpu-bind-group-layout;
474
+ }
475
+ enum gpu-primitive-topology {
476
+ point-list,
477
+ line-list,
478
+ line-strip,
479
+ triangle-list,
480
+ triangle-strip,
481
+ }
482
+ enum gpu-front-face {
483
+ ccw,
484
+ cw,
485
+ }
486
+ enum gpu-cull-mode {
487
+ none,
488
+ front,
489
+ back,
490
+ }
491
+ type gpu-color-write-flags = u32;
492
+ resource gpu-color-write {
493
+ RED: static func() -> gpu-flags-constant;
494
+ GREEN: static func() -> gpu-flags-constant;
495
+ BLUE: static func() -> gpu-flags-constant;
496
+ ALPHA: static func() -> gpu-flags-constant;
497
+ ALL: static func() -> gpu-flags-constant;
498
+ }
499
+ enum gpu-blend-factor {
500
+ zero,
501
+ one,
502
+ src,
503
+ one-minus-src,
504
+ src-alpha,
505
+ one-minus-src-alpha,
506
+ dst,
507
+ one-minus-dst,
508
+ dst-alpha,
509
+ one-minus-dst-alpha,
510
+ src-alpha-saturated,
511
+ constant,
512
+ one-minus-constant,
513
+ src1,
514
+ one-minus-src1,
515
+ src1-alpha,
516
+ one-minus-src1-alpha,
517
+ }
518
+ enum gpu-blend-operation {
519
+ add,
520
+ subtract,
521
+ reverse-subtract,
522
+ min,
523
+ max,
524
+ }
525
+ record gpu-blend-component {
526
+ operation: option<gpu-blend-operation>,
527
+ src-factor: option<gpu-blend-factor>,
528
+ dst-factor: option<gpu-blend-factor>,
529
+ }
530
+ record gpu-blend-state {
531
+ color: gpu-blend-component,
532
+ alpha: gpu-blend-component,
533
+ }
534
+ record gpu-color-target-state {
535
+ format: gpu-texture-format,
536
+ blend: option<gpu-blend-state>,
537
+ write-mask: option<gpu-color-write-flags>,
538
+ }
539
+ record gpu-fragment-state {
540
+ targets: list<option<gpu-color-target-state>>,
541
+ module: borrow<gpu-shader-module>,
542
+ entry-point: option<string>,
543
+ constants: option<record-gpu-pipeline-constant-value>,
544
+ }
545
+ enum gpu-stencil-operation {
546
+ keep,
547
+ zero,
548
+ replace,
549
+ invert,
550
+ increment-clamp,
551
+ decrement-clamp,
552
+ increment-wrap,
553
+ decrement-wrap,
554
+ }
555
+ record gpu-stencil-face-state {
556
+ compare: option<gpu-compare-function>,
557
+ fail-op: option<gpu-stencil-operation>,
558
+ depth-fail-op: option<gpu-stencil-operation>,
559
+ pass-op: option<gpu-stencil-operation>,
560
+ }
561
+ enum gpu-index-format {
562
+ uint16,
563
+ uint32,
564
+ }
565
+ record gpu-primitive-state {
566
+ topology: option<gpu-primitive-topology>,
567
+ strip-index-format: option<gpu-index-format>,
568
+ front-face: option<gpu-front-face>,
569
+ cull-mode: option<gpu-cull-mode>,
570
+ unclipped-depth: option<bool>,
571
+ }
572
+ enum gpu-vertex-format {
573
+ uint8,
574
+ uint8x2,
575
+ uint8x4,
576
+ sint8,
577
+ sint8x2,
578
+ sint8x4,
579
+ unorm8,
580
+ unorm8x2,
581
+ unorm8x4,
582
+ snorm8,
583
+ snorm8x2,
584
+ snorm8x4,
585
+ uint16,
586
+ uint16x2,
587
+ uint16x4,
588
+ sint16,
589
+ sint16x2,
590
+ sint16x4,
591
+ unorm16,
592
+ unorm16x2,
593
+ unorm16x4,
594
+ snorm16,
595
+ snorm16x2,
596
+ snorm16x4,
597
+ float16,
598
+ float16x2,
599
+ float16x4,
600
+ float32,
601
+ float32x2,
602
+ float32x3,
603
+ float32x4,
604
+ uint32,
605
+ uint32x2,
606
+ uint32x3,
607
+ uint32x4,
608
+ sint32,
609
+ sint32x2,
610
+ sint32x3,
611
+ sint32x4,
612
+ unorm1010102,
613
+ unorm8x4-bgra,
614
+ }
615
+ enum gpu-vertex-step-mode {
616
+ vertex,
617
+ instance,
618
+ }
619
+ resource gpu-command-buffer {
620
+ label: func() -> string;
621
+ set-label: func(label: string);
622
+ }
623
+ record gpu-command-buffer-descriptor {
624
+ label: option<string>,
625
+ }
626
+ resource gpu-command-encoder {
627
+ begin-render-pass: func(descriptor: gpu-render-pass-descriptor) -> gpu-render-pass-encoder;
628
+ begin-compute-pass: func(descriptor: option<gpu-compute-pass-descriptor>) -> gpu-compute-pass-encoder;
629
+ copy-buffer-to-buffer: func(source: borrow<gpu-buffer>, source-offset: gpu-size64, destination: borrow<gpu-buffer>, destination-offset: gpu-size64, size: gpu-size64);
630
+ copy-buffer-to-texture: func(source: gpu-texel-copy-buffer-info, destination: gpu-texel-copy-texture-info, copy-size: gpu-extent3-d);
631
+ copy-texture-to-buffer: func(source: gpu-texel-copy-texture-info, destination: gpu-texel-copy-buffer-info, copy-size: gpu-extent3-d);
632
+ copy-texture-to-texture: func(source: gpu-texel-copy-texture-info, destination: gpu-texel-copy-texture-info, copy-size: gpu-extent3-d);
633
+ clear-buffer: func(buffer: borrow<gpu-buffer>, offset: option<gpu-size64>, size: option<gpu-size64>);
634
+ resolve-query-set: func(query-set: borrow<gpu-query-set>, first-query: gpu-size32, query-count: gpu-size32, destination: borrow<gpu-buffer>, destination-offset: gpu-size64);
635
+ finish: func(descriptor: option<gpu-command-buffer-descriptor>) -> gpu-command-buffer;
636
+ label: func() -> string;
637
+ set-label: func(label: string);
638
+ push-debug-group: func(group-label: string);
639
+ pop-debug-group: func();
640
+ insert-debug-marker: func(marker-label: string);
641
+ }
642
+ record gpu-command-encoder-descriptor {
643
+ label: option<string>,
644
+ }
645
+ resource gpu-compute-pass-encoder {
646
+ set-pipeline: func(pipeline: borrow<gpu-compute-pipeline>);
647
+ dispatch-workgroups: func(workgroup-count-x: gpu-size32, workgroup-count-y: option<gpu-size32>, workgroup-count-z: option<gpu-size32>);
648
+ dispatch-workgroups-indirect: func(indirect-buffer: borrow<gpu-buffer>, indirect-offset: gpu-size64);
649
+ end: func();
650
+ label: func() -> string;
651
+ set-label: func(label: string);
652
+ push-debug-group: func(group-label: string);
653
+ pop-debug-group: func();
654
+ insert-debug-marker: func(marker-label: string);
655
+ set-bind-group: func(index: gpu-index32, bind-group: option<borrow<gpu-bind-group>>, dynamic-offsets-data: option<list<gpu-buffer-dynamic-offset>>, dynamic-offsets-data-start: option<gpu-size64>, dynamic-offsets-data-length: option<gpu-size32>) -> result<_, set-bind-group-error>;
656
+ }
657
+ resource gpu-render-pass-encoder {
658
+ set-viewport: func(x: f32, y: f32, width: f32, height: f32, min-depth: f32, max-depth: f32);
659
+ set-scissor-rect: func(x: gpu-integer-coordinate, y: gpu-integer-coordinate, width: gpu-integer-coordinate, height: gpu-integer-coordinate);
660
+ set-blend-constant: func(color: gpu-color);
661
+ set-stencil-reference: func(reference: gpu-stencil-value);
662
+ begin-occlusion-query: func(query-index: gpu-size32);
663
+ end-occlusion-query: func();
664
+ execute-bundles: func(bundles: list<borrow<gpu-render-bundle>>);
665
+ end: func();
666
+ label: func() -> string;
667
+ set-label: func(label: string);
668
+ push-debug-group: func(group-label: string);
669
+ pop-debug-group: func();
670
+ insert-debug-marker: func(marker-label: string);
671
+ set-bind-group: func(index: gpu-index32, bind-group: option<borrow<gpu-bind-group>>, dynamic-offsets-data: option<list<gpu-buffer-dynamic-offset>>, dynamic-offsets-data-start: option<gpu-size64>, dynamic-offsets-data-length: option<gpu-size32>) -> result<_, set-bind-group-error>;
672
+ set-pipeline: func(pipeline: borrow<gpu-render-pipeline>);
673
+ set-index-buffer: func(buffer: borrow<gpu-buffer>, index-format: gpu-index-format, offset: option<gpu-size64>, size: option<gpu-size64>);
674
+ set-vertex-buffer: func(slot: gpu-index32, buffer: option<borrow<gpu-buffer>>, offset: option<gpu-size64>, size: option<gpu-size64>);
675
+ draw: func(vertex-count: gpu-size32, instance-count: option<gpu-size32>, first-vertex: option<gpu-size32>, first-instance: option<gpu-size32>);
676
+ draw-indexed: func(index-count: gpu-size32, instance-count: option<gpu-size32>, first-index: option<gpu-size32>, base-vertex: option<gpu-signed-offset32>, first-instance: option<gpu-size32>);
677
+ draw-indirect: func(indirect-buffer: borrow<gpu-buffer>, indirect-offset: gpu-size64);
678
+ draw-indexed-indirect: func(indirect-buffer: borrow<gpu-buffer>, indirect-offset: gpu-size64);
679
+ }
680
+ enum gpu-load-op {
681
+ load,
682
+ clear,
683
+ }
684
+ enum gpu-store-op {
685
+ store,
686
+ discard,
687
+ }
688
+ resource gpu-render-bundle {
689
+ label: func() -> string;
690
+ set-label: func(label: string);
691
+ }
692
+ record gpu-render-bundle-descriptor {
693
+ label: option<string>,
694
+ }
695
+ resource gpu-render-bundle-encoder {
696
+ finish: func(descriptor: option<gpu-render-bundle-descriptor>) -> gpu-render-bundle;
697
+ label: func() -> string;
698
+ set-label: func(label: string);
699
+ push-debug-group: func(group-label: string);
700
+ pop-debug-group: func();
701
+ insert-debug-marker: func(marker-label: string);
702
+ set-bind-group: func(index: gpu-index32, bind-group: option<borrow<gpu-bind-group>>, dynamic-offsets-data: option<list<gpu-buffer-dynamic-offset>>, dynamic-offsets-data-start: option<gpu-size64>, dynamic-offsets-data-length: option<gpu-size32>) -> result<_, set-bind-group-error>;
703
+ set-pipeline: func(pipeline: borrow<gpu-render-pipeline>);
704
+ set-index-buffer: func(buffer: borrow<gpu-buffer>, index-format: gpu-index-format, offset: option<gpu-size64>, size: option<gpu-size64>);
705
+ set-vertex-buffer: func(slot: gpu-index32, buffer: option<borrow<gpu-buffer>>, offset: option<gpu-size64>, size: option<gpu-size64>);
706
+ draw: func(vertex-count: gpu-size32, instance-count: option<gpu-size32>, first-vertex: option<gpu-size32>, first-instance: option<gpu-size32>);
707
+ draw-indexed: func(index-count: gpu-size32, instance-count: option<gpu-size32>, first-index: option<gpu-size32>, base-vertex: option<gpu-signed-offset32>, first-instance: option<gpu-size32>);
708
+ draw-indirect: func(indirect-buffer: borrow<gpu-buffer>, indirect-offset: gpu-size64);
709
+ draw-indexed-indirect: func(indirect-buffer: borrow<gpu-buffer>, indirect-offset: gpu-size64);
710
+ }
711
+ record gpu-queue-descriptor {
712
+ label: option<string>,
713
+ }
714
+ record gpu-device-descriptor {
715
+ required-features: option<list<gpu-feature-name>>,
716
+ required-limits: option<record-option-gpu-size64>,
717
+ default-queue: option<gpu-queue-descriptor>,
718
+ label: option<string>,
719
+ }
720
+ resource gpu-queue {
721
+ submit: func(command-buffers: list<borrow<gpu-command-buffer>>);
722
+ on-submitted-work-done: func();
723
+ write-buffer-with-copy: func(buffer: borrow<gpu-buffer>, buffer-offset: gpu-size64, data: list<u8>, data-offset: option<gpu-size64>, size: option<gpu-size64>) -> result<_, write-buffer-error>;
724
+ write-texture-with-copy: func(destination: gpu-texel-copy-texture-info, data: list<u8>, data-layout: gpu-texel-copy-buffer-layout, size: gpu-extent3-d);
725
+ label: func() -> string;
726
+ set-label: func(label: string);
727
+ }
728
+ resource gpu-query-set {
729
+ destroy: func();
730
+ %type: func() -> gpu-query-type;
731
+ count: func() -> gpu-size32-out;
732
+ label: func() -> string;
733
+ set-label: func(label: string);
734
+ }
735
+ enum gpu-query-type {
736
+ occlusion,
737
+ timestamp,
738
+ }
739
+ resource gpu-canvas-context {
740
+ configure: func(configuration: gpu-canvas-configuration);
741
+ unconfigure: func();
742
+ get-configuration: func() -> option<gpu-canvas-configuration-owned>;
743
+ get-current-texture: func() -> gpu-texture;
744
+ }
745
+ enum gpu-canvas-alpha-mode {
746
+ opaque,
747
+ premultiplied,
748
+ }
749
+ enum gpu-canvas-tone-mapping-mode {
750
+ standard,
751
+ extended,
752
+ }
753
+ record gpu-canvas-tone-mapping {
754
+ mode: option<gpu-canvas-tone-mapping-mode>,
755
+ }
756
+ record gpu-canvas-configuration {
757
+ device: borrow<gpu-device>,
758
+ format: gpu-texture-format,
759
+ usage: option<gpu-texture-usage-flags>,
760
+ view-formats: option<list<gpu-texture-format>>,
761
+ color-space: option<predefined-color-space>,
762
+ tone-mapping: option<gpu-canvas-tone-mapping>,
763
+ alpha-mode: option<gpu-canvas-alpha-mode>,
764
+ }
765
+ enum gpu-device-lost-reason {
766
+ unknown,
767
+ destroyed,
768
+ }
769
+ resource gpu-device-lost-info {
770
+ reason: func() -> gpu-device-lost-reason;
771
+ message: func() -> string;
772
+ }
773
+ resource gpu-error {
774
+ message: func() -> string;
775
+ kind: func() -> gpu-error-kind;
776
+ }
777
+ enum gpu-error-filter {
778
+ validation,
779
+ out-of-memory,
780
+ internal,
781
+ }
782
+ resource gpu-uncaptured-error-event {
783
+ error: func() -> gpu-error;
784
+ }
785
+ type gpu-buffer-dynamic-offset = u32;
786
+ type gpu-stencil-value = u32;
787
+ record gpu-render-pass-depth-stencil-attachment {
788
+ view: borrow<gpu-texture-view>,
789
+ depth-clear-value: option<f32>,
790
+ depth-load-op: option<gpu-load-op>,
791
+ depth-store-op: option<gpu-store-op>,
792
+ depth-read-only: option<bool>,
793
+ stencil-clear-value: option<gpu-stencil-value>,
794
+ stencil-load-op: option<gpu-load-op>,
795
+ stencil-store-op: option<gpu-store-op>,
796
+ stencil-read-only: option<bool>,
797
+ }
798
+ type gpu-sample-mask = u32;
799
+ type gpu-depth-bias = s32;
800
+ record gpu-depth-stencil-state {
801
+ format: gpu-texture-format,
802
+ depth-write-enabled: option<bool>,
803
+ depth-compare: option<gpu-compare-function>,
804
+ stencil-front: option<gpu-stencil-face-state>,
805
+ stencil-back: option<gpu-stencil-face-state>,
806
+ stencil-read-mask: option<gpu-stencil-value>,
807
+ stencil-write-mask: option<gpu-stencil-value>,
808
+ depth-bias: option<gpu-depth-bias>,
809
+ depth-bias-slope-scale: option<f32>,
810
+ depth-bias-clamp: option<f32>,
811
+ }
812
+ type gpu-size64 = u64;
813
+ record gpu-buffer-descriptor {
814
+ size: gpu-size64,
815
+ usage: gpu-buffer-usage-flags,
816
+ mapped-at-creation: option<bool>,
817
+ label: option<string>,
818
+ }
819
+ record gpu-buffer-binding-layout {
820
+ %type: option<gpu-buffer-binding-type>,
821
+ has-dynamic-offset: option<bool>,
822
+ min-binding-size: option<gpu-size64>,
823
+ }
824
+ record gpu-buffer-binding {
825
+ buffer: borrow<gpu-buffer>,
826
+ offset: option<gpu-size64>,
827
+ size: option<gpu-size64>,
828
+ }
829
+ variant gpu-binding-resource {
830
+ gpu-buffer-binding(gpu-buffer-binding),
831
+ gpu-sampler(borrow<gpu-sampler>),
832
+ gpu-texture-view(borrow<gpu-texture-view>),
833
+ }
834
+ type gpu-integer-coordinate = u32;
835
+ record gpu-texture-view-descriptor {
836
+ format: option<gpu-texture-format>,
837
+ dimension: option<gpu-texture-view-dimension>,
838
+ usage: option<gpu-texture-usage-flags>,
839
+ aspect: option<gpu-texture-aspect>,
840
+ base-mip-level: option<gpu-integer-coordinate>,
841
+ mip-level-count: option<gpu-integer-coordinate>,
842
+ base-array-layer: option<gpu-integer-coordinate>,
843
+ array-layer-count: option<gpu-integer-coordinate>,
844
+ label: option<string>,
845
+ }
846
+ type gpu-index32 = u32;
847
+ record gpu-bind-group-layout-entry {
848
+ binding: gpu-index32,
849
+ visibility: gpu-shader-stage-flags,
850
+ buffer: option<gpu-buffer-binding-layout>,
851
+ sampler: option<gpu-sampler-binding-layout>,
852
+ texture: option<gpu-texture-binding-layout>,
853
+ storage-texture: option<gpu-storage-texture-binding-layout>,
854
+ }
855
+ record gpu-bind-group-layout-descriptor {
856
+ entries: list<gpu-bind-group-layout-entry>,
857
+ label: option<string>,
858
+ }
859
+ record gpu-bind-group-entry {
860
+ binding: gpu-index32,
861
+ %resource: gpu-binding-resource,
862
+ }
863
+ record gpu-bind-group-descriptor {
864
+ layout: borrow<gpu-bind-group-layout>,
865
+ entries: list<gpu-bind-group-entry>,
866
+ label: option<string>,
867
+ }
868
+ record gpu-vertex-attribute {
869
+ format: gpu-vertex-format,
870
+ offset: gpu-size64,
871
+ shader-location: gpu-index32,
872
+ }
873
+ record gpu-vertex-buffer-layout {
874
+ array-stride: gpu-size64,
875
+ step-mode: option<gpu-vertex-step-mode>,
876
+ attributes: list<gpu-vertex-attribute>,
877
+ }
878
+ record gpu-vertex-state {
879
+ buffers: option<list<option<gpu-vertex-buffer-layout>>>,
880
+ module: borrow<gpu-shader-module>,
881
+ entry-point: option<string>,
882
+ constants: option<record-gpu-pipeline-constant-value>,
883
+ }
884
+ type gpu-size32 = u32;
885
+ record gpu-multisample-state {
886
+ count: option<gpu-size32>,
887
+ mask: option<gpu-sample-mask>,
888
+ alpha-to-coverage-enabled: option<bool>,
889
+ }
890
+ record gpu-render-pipeline-descriptor {
891
+ vertex: gpu-vertex-state,
892
+ primitive: option<gpu-primitive-state>,
893
+ depth-stencil: option<gpu-depth-stencil-state>,
894
+ multisample: option<gpu-multisample-state>,
895
+ fragment: option<gpu-fragment-state>,
896
+ layout: gpu-layout-mode,
897
+ label: option<string>,
898
+ }
899
+ record gpu-texel-copy-buffer-layout {
900
+ offset: option<gpu-size64>,
901
+ bytes-per-row: option<gpu-size32>,
902
+ rows-per-image: option<gpu-size32>,
903
+ }
904
+ record gpu-texel-copy-buffer-info {
905
+ buffer: borrow<gpu-buffer>,
906
+ offset: option<gpu-size64>,
907
+ bytes-per-row: option<gpu-size32>,
908
+ rows-per-image: option<gpu-size32>,
909
+ }
910
+ record gpu-compute-pass-timestamp-writes {
911
+ query-set: borrow<gpu-query-set>,
912
+ beginning-of-pass-write-index: option<gpu-size32>,
913
+ end-of-pass-write-index: option<gpu-size32>,
914
+ }
915
+ record gpu-compute-pass-descriptor {
916
+ timestamp-writes: option<gpu-compute-pass-timestamp-writes>,
917
+ label: option<string>,
918
+ }
919
+ record gpu-render-pass-timestamp-writes {
920
+ query-set: borrow<gpu-query-set>,
921
+ beginning-of-pass-write-index: option<gpu-size32>,
922
+ end-of-pass-write-index: option<gpu-size32>,
923
+ }
924
+ record gpu-render-bundle-encoder-descriptor {
925
+ depth-read-only: option<bool>,
926
+ stencil-read-only: option<bool>,
927
+ color-formats: list<option<gpu-texture-format>>,
928
+ depth-stencil-format: option<gpu-texture-format>,
929
+ sample-count: option<gpu-size32>,
930
+ label: option<string>,
931
+ }
932
+ record gpu-query-set-descriptor {
933
+ %type: gpu-query-type,
934
+ count: gpu-size32,
935
+ label: option<string>,
936
+ }
937
+ type gpu-signed-offset32 = s32;
938
+ type gpu-size64-out = u64;
939
+ type gpu-integer-coordinate-out = u32;
940
+ type gpu-size32-out = u32;
941
+ type gpu-flags-constant = u32;
942
+ record gpu-color {
943
+ r: f64,
944
+ g: f64,
945
+ b: f64,
946
+ a: f64,
947
+ }
948
+ record gpu-render-pass-color-attachment {
949
+ view: borrow<gpu-texture-view>,
950
+ depth-slice: option<gpu-integer-coordinate>,
951
+ resolve-target: option<borrow<gpu-texture-view>>,
952
+ clear-value: option<gpu-color>,
953
+ load-op: gpu-load-op,
954
+ store-op: gpu-store-op,
955
+ }
956
+ record gpu-render-pass-descriptor {
957
+ color-attachments: list<option<gpu-render-pass-color-attachment>>,
958
+ depth-stencil-attachment: option<gpu-render-pass-depth-stencil-attachment>,
959
+ occlusion-query-set: option<borrow<gpu-query-set>>,
960
+ timestamp-writes: option<gpu-render-pass-timestamp-writes>,
961
+ max-draw-count: option<gpu-size64>,
962
+ label: option<string>,
963
+ }
964
+ record gpu-origin3-d {
965
+ x: option<gpu-integer-coordinate>,
966
+ y: option<gpu-integer-coordinate>,
967
+ z: option<gpu-integer-coordinate>,
968
+ }
969
+ record gpu-texel-copy-texture-info {
970
+ texture: borrow<gpu-texture>,
971
+ mip-level: option<gpu-integer-coordinate>,
972
+ origin: option<gpu-origin3-d>,
973
+ aspect: option<gpu-texture-aspect>,
974
+ }
975
+ record gpu-copy-external-image-dest-info {
976
+ color-space: option<predefined-color-space>,
977
+ premultiplied-alpha: option<bool>,
978
+ texture: borrow<gpu-texture>,
979
+ mip-level: option<gpu-integer-coordinate>,
980
+ origin: option<gpu-origin3-d>,
981
+ aspect: option<gpu-texture-aspect>,
982
+ }
983
+ record gpu-extent3-d {
984
+ width: gpu-integer-coordinate,
985
+ height: option<gpu-integer-coordinate>,
986
+ depth-or-array-layers: option<gpu-integer-coordinate>,
987
+ }
988
+ record gpu-texture-descriptor {
989
+ size: gpu-extent3-d,
990
+ mip-level-count: option<gpu-integer-coordinate>,
991
+ sample-count: option<gpu-size32>,
992
+ dimension: option<gpu-texture-dimension>,
993
+ format: gpu-texture-format,
994
+ usage: gpu-texture-usage-flags,
995
+ view-formats: option<list<gpu-texture-format>>,
996
+ label: option<string>,
997
+ }
998
+ record gpu-canvas-configuration-owned {
999
+ device: gpu-device,
1000
+ format: gpu-texture-format,
1001
+ usage: option<gpu-texture-usage-flags>,
1002
+ view-formats: option<list<gpu-texture-format>>,
1003
+ color-space: option<predefined-color-space>,
1004
+ tone-mapping: option<gpu-canvas-tone-mapping>,
1005
+ alpha-mode: option<gpu-canvas-alpha-mode>,
1006
+ }
1007
+ enum predefined-color-space {
1008
+ srgb,
1009
+ display-p3,
1010
+ }
1011
+ get-gpu: func() -> gpu;
1012
+ variant gpu-error-kind {
1013
+ validation-error,
1014
+ out-of-memory-error,
1015
+ internal-error,
1016
+ }
1017
+ variant request-device-error-kind {
1018
+ type-error,
1019
+ operation-error,
1020
+ }
1021
+ record request-device-error {
1022
+ kind: request-device-error-kind,
1023
+ message: string,
1024
+ }
1025
+ variant create-pipeline-error-kind {
1026
+ gpu-pipeline-error(gpu-pipeline-error-reason),
1027
+ }
1028
+ record create-pipeline-error {
1029
+ kind: create-pipeline-error-kind,
1030
+ message: string,
1031
+ }
1032
+ variant create-query-set-error-kind {
1033
+ type-error,
1034
+ }
1035
+ record create-query-set-error {
1036
+ kind: create-query-set-error-kind,
1037
+ message: string,
1038
+ }
1039
+ variant pop-error-scope-error-kind {
1040
+ operation-error,
1041
+ }
1042
+ record pop-error-scope-error {
1043
+ kind: pop-error-scope-error-kind,
1044
+ message: string,
1045
+ }
1046
+ variant map-async-error-kind {
1047
+ operation-error,
1048
+ range-error,
1049
+ abort-error,
1050
+ }
1051
+ record map-async-error {
1052
+ kind: map-async-error-kind,
1053
+ message: string,
1054
+ }
1055
+ variant get-mapped-range-error-kind {
1056
+ operation-error,
1057
+ range-error,
1058
+ type-error,
1059
+ }
1060
+ record get-mapped-range-error {
1061
+ kind: get-mapped-range-error-kind,
1062
+ message: string,
1063
+ }
1064
+ variant unmap-error-kind {
1065
+ abort-error,
1066
+ }
1067
+ record unmap-error {
1068
+ kind: unmap-error-kind,
1069
+ message: string,
1070
+ }
1071
+ variant set-bind-group-error-kind {
1072
+ range-error,
1073
+ }
1074
+ record set-bind-group-error {
1075
+ kind: set-bind-group-error-kind,
1076
+ message: string,
1077
+ }
1078
+ variant write-buffer-error-kind {
1079
+ operation-error,
1080
+ }
1081
+ record write-buffer-error {
1082
+ kind: write-buffer-error-kind,
1083
+ message: string,
1084
+ }
1085
+ }