@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.
- package/README.md +26 -0
- package/dist/index.js +1665 -0
- package/package.json +35 -0
- package/types/interfaces/wasi-cli-run.d.ts +5 -0
- package/types/interfaces/wasi-cli-stdout.d.ts +3 -0
- package/types/interfaces/wasi-frame-buffer-frame-buffer.d.ts +21 -0
- package/types/interfaces/wasi-graphics-context-graphics-context.d.ts +17 -0
- package/types/interfaces/wasi-io-error.d.ts +18 -0
- package/types/interfaces/wasi-io-poll.d.ts +43 -0
- package/types/interfaces/wasi-io-streams.d.ts +240 -0
- package/types/interfaces/wasi-surface-surface.d.ts +400 -0
- package/types/interfaces/wasi-webgpu-webgpu.d.ts +1636 -0
- package/types/wit.d.ts +10 -0
- package/wit/deps/cli/command.wit +7 -0
- package/wit/deps/cli/environment.wit +18 -0
- package/wit/deps/cli/exit.wit +4 -0
- package/wit/deps/cli/imports.wit +20 -0
- package/wit/deps/cli/run.wit +4 -0
- package/wit/deps/cli/stdio.wit +17 -0
- package/wit/deps/cli/terminal.wit +49 -0
- package/wit/deps/clocks/monotonic-clock.wit +45 -0
- package/wit/deps/clocks/wall-clock.wit +42 -0
- package/wit/deps/clocks/world.wit +6 -0
- package/wit/deps/filesystem/preopens.wit +8 -0
- package/wit/deps/filesystem/types.wit +634 -0
- package/wit/deps/filesystem/world.wit +6 -0
- package/wit/deps/frame-buffer/frame-buffer.wit +23 -0
- package/wit/deps/graphics-context/graphics-context.wit +18 -0
- package/wit/deps/io/error.wit +34 -0
- package/wit/deps/io/poll.wit +41 -0
- package/wit/deps/io/streams.wit +262 -0
- package/wit/deps/io/world.wit +6 -0
- package/wit/deps/random/insecure-seed.wit +25 -0
- package/wit/deps/random/insecure.wit +22 -0
- package/wit/deps/random/random.wit +26 -0
- package/wit/deps/random/world.wit +7 -0
- package/wit/deps/sockets/instance-network.wit +9 -0
- package/wit/deps/sockets/ip-name-lookup.wit +51 -0
- package/wit/deps/sockets/network.wit +145 -0
- package/wit/deps/sockets/tcp-create-socket.wit +27 -0
- package/wit/deps/sockets/tcp.wit +353 -0
- package/wit/deps/sockets/udp-create-socket.wit +27 -0
- package/wit/deps/sockets/udp.wit +266 -0
- package/wit/deps/sockets/world.wit +11 -0
- package/wit/deps/surface/surface.wit +248 -0
- package/wit/deps/webgpu/imports.wit +5 -0
- package/wit/deps/webgpu/webgpu.wit +1085 -0
- package/wit/deps.lock +51 -0
- package/wit/deps.toml +18 -0
- package/wit/world.wit +10 -0
|
@@ -0,0 +1,1636 @@
|
|
|
1
|
+
/** @module Interface wasi:webgpu/webgpu@0.0.1 **/
|
|
2
|
+
export function getGpu(): Gpu;
|
|
3
|
+
export type Pollable = import('./wasi-io-poll.js').Pollable;
|
|
4
|
+
export type Context = import('./wasi-graphics-context-graphics-context.js').Context;
|
|
5
|
+
export type AbstractBuffer = import('./wasi-graphics-context-graphics-context.js').AbstractBuffer;
|
|
6
|
+
/**
|
|
7
|
+
* # Variants
|
|
8
|
+
*
|
|
9
|
+
* ## `"low-power"`
|
|
10
|
+
*
|
|
11
|
+
* ## `"high-performance"`
|
|
12
|
+
*/
|
|
13
|
+
export type GpuPowerPreference = 'low-power' | 'high-performance';
|
|
14
|
+
export interface GpuRequestAdapterOptions {
|
|
15
|
+
featureLevel?: string,
|
|
16
|
+
powerPreference?: GpuPowerPreference,
|
|
17
|
+
forceFallbackAdapter?: boolean,
|
|
18
|
+
xrCompatible?: boolean,
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* # Variants
|
|
22
|
+
*
|
|
23
|
+
* ## `"depth-clip-control"`
|
|
24
|
+
*
|
|
25
|
+
* ## `"depth32float-stencil8"`
|
|
26
|
+
*
|
|
27
|
+
* ## `"texture-compression-bc"`
|
|
28
|
+
*
|
|
29
|
+
* ## `"texture-compression-bc-sliced3d"`
|
|
30
|
+
*
|
|
31
|
+
* ## `"texture-compression-etc2"`
|
|
32
|
+
*
|
|
33
|
+
* ## `"texture-compression-astc"`
|
|
34
|
+
*
|
|
35
|
+
* ## `"texture-compression-astc-sliced3d"`
|
|
36
|
+
*
|
|
37
|
+
* ## `"timestamp-query"`
|
|
38
|
+
*
|
|
39
|
+
* ## `"indirect-first-instance"`
|
|
40
|
+
*
|
|
41
|
+
* ## `"shader-f16"`
|
|
42
|
+
*
|
|
43
|
+
* ## `"rg11b10ufloat-renderable"`
|
|
44
|
+
*
|
|
45
|
+
* ## `"bgra8unorm-storage"`
|
|
46
|
+
*
|
|
47
|
+
* ## `"float32-filterable"`
|
|
48
|
+
*
|
|
49
|
+
* ## `"float32-blendable"`
|
|
50
|
+
*
|
|
51
|
+
* ## `"clip-distances"`
|
|
52
|
+
*
|
|
53
|
+
* ## `"dual-source-blending"`
|
|
54
|
+
*
|
|
55
|
+
* ## `"subgroups"`
|
|
56
|
+
*/
|
|
57
|
+
export type GpuFeatureName = 'depth-clip-control' | 'depth32float-stencil8' | 'texture-compression-bc' | 'texture-compression-bc-sliced3d' | 'texture-compression-etc2' | 'texture-compression-astc' | 'texture-compression-astc-sliced3d' | 'timestamp-query' | 'indirect-first-instance' | 'shader-f16' | 'rg11b10ufloat-renderable' | 'bgra8unorm-storage' | 'float32-filterable' | 'float32-blendable' | 'clip-distances' | 'dual-source-blending' | 'subgroups';
|
|
58
|
+
/**
|
|
59
|
+
* # Variants
|
|
60
|
+
*
|
|
61
|
+
* ## `"unmapped"`
|
|
62
|
+
*
|
|
63
|
+
* ## `"pending"`
|
|
64
|
+
*
|
|
65
|
+
* ## `"mapped"`
|
|
66
|
+
*/
|
|
67
|
+
export type GpuBufferMapState = 'unmapped' | 'pending' | 'mapped';
|
|
68
|
+
export type GpuBufferUsageFlags = number;
|
|
69
|
+
export type GpuMapModeFlags = number;
|
|
70
|
+
/**
|
|
71
|
+
* # Variants
|
|
72
|
+
*
|
|
73
|
+
* ## `"d1"`
|
|
74
|
+
*
|
|
75
|
+
* ## `"d2"`
|
|
76
|
+
*
|
|
77
|
+
* ## `"d3"`
|
|
78
|
+
*/
|
|
79
|
+
export type GpuTextureDimension = 'd1' | 'd2' | 'd3';
|
|
80
|
+
export type GpuTextureUsageFlags = number;
|
|
81
|
+
/**
|
|
82
|
+
* # Variants
|
|
83
|
+
*
|
|
84
|
+
* ## `"d1"`
|
|
85
|
+
*
|
|
86
|
+
* ## `"d2"`
|
|
87
|
+
*
|
|
88
|
+
* ## `"d2-array"`
|
|
89
|
+
*
|
|
90
|
+
* ## `"cube"`
|
|
91
|
+
*
|
|
92
|
+
* ## `"cube-array"`
|
|
93
|
+
*
|
|
94
|
+
* ## `"d3"`
|
|
95
|
+
*/
|
|
96
|
+
export type GpuTextureViewDimension = 'd1' | 'd2' | 'd2-array' | 'cube' | 'cube-array' | 'd3';
|
|
97
|
+
/**
|
|
98
|
+
* # Variants
|
|
99
|
+
*
|
|
100
|
+
* ## `"all"`
|
|
101
|
+
*
|
|
102
|
+
* ## `"stencil-only"`
|
|
103
|
+
*
|
|
104
|
+
* ## `"depth-only"`
|
|
105
|
+
*/
|
|
106
|
+
export type GpuTextureAspect = 'all' | 'stencil-only' | 'depth-only';
|
|
107
|
+
/**
|
|
108
|
+
* # Variants
|
|
109
|
+
*
|
|
110
|
+
* ## `"r8unorm"`
|
|
111
|
+
*
|
|
112
|
+
* ## `"r8snorm"`
|
|
113
|
+
*
|
|
114
|
+
* ## `"r8uint"`
|
|
115
|
+
*
|
|
116
|
+
* ## `"r8sint"`
|
|
117
|
+
*
|
|
118
|
+
* ## `"r16uint"`
|
|
119
|
+
*
|
|
120
|
+
* ## `"r16sint"`
|
|
121
|
+
*
|
|
122
|
+
* ## `"r16float"`
|
|
123
|
+
*
|
|
124
|
+
* ## `"rg8unorm"`
|
|
125
|
+
*
|
|
126
|
+
* ## `"rg8snorm"`
|
|
127
|
+
*
|
|
128
|
+
* ## `"rg8uint"`
|
|
129
|
+
*
|
|
130
|
+
* ## `"rg8sint"`
|
|
131
|
+
*
|
|
132
|
+
* ## `"r32uint"`
|
|
133
|
+
*
|
|
134
|
+
* ## `"r32sint"`
|
|
135
|
+
*
|
|
136
|
+
* ## `"r32float"`
|
|
137
|
+
*
|
|
138
|
+
* ## `"rg16uint"`
|
|
139
|
+
*
|
|
140
|
+
* ## `"rg16sint"`
|
|
141
|
+
*
|
|
142
|
+
* ## `"rg16float"`
|
|
143
|
+
*
|
|
144
|
+
* ## `"rgba8unorm"`
|
|
145
|
+
*
|
|
146
|
+
* ## `"rgba8unorm-srgb"`
|
|
147
|
+
*
|
|
148
|
+
* ## `"rgba8snorm"`
|
|
149
|
+
*
|
|
150
|
+
* ## `"rgba8uint"`
|
|
151
|
+
*
|
|
152
|
+
* ## `"rgba8sint"`
|
|
153
|
+
*
|
|
154
|
+
* ## `"bgra8unorm"`
|
|
155
|
+
*
|
|
156
|
+
* ## `"bgra8unorm-srgb"`
|
|
157
|
+
*
|
|
158
|
+
* ## `"rgb9e5ufloat"`
|
|
159
|
+
*
|
|
160
|
+
* ## `"rgb10a2uint"`
|
|
161
|
+
*
|
|
162
|
+
* ## `"rgb10a2unorm"`
|
|
163
|
+
*
|
|
164
|
+
* ## `"rg11b10ufloat"`
|
|
165
|
+
*
|
|
166
|
+
* ## `"rg32uint"`
|
|
167
|
+
*
|
|
168
|
+
* ## `"rg32sint"`
|
|
169
|
+
*
|
|
170
|
+
* ## `"rg32float"`
|
|
171
|
+
*
|
|
172
|
+
* ## `"rgba16uint"`
|
|
173
|
+
*
|
|
174
|
+
* ## `"rgba16sint"`
|
|
175
|
+
*
|
|
176
|
+
* ## `"rgba16float"`
|
|
177
|
+
*
|
|
178
|
+
* ## `"rgba32uint"`
|
|
179
|
+
*
|
|
180
|
+
* ## `"rgba32sint"`
|
|
181
|
+
*
|
|
182
|
+
* ## `"rgba32float"`
|
|
183
|
+
*
|
|
184
|
+
* ## `"stencil8"`
|
|
185
|
+
*
|
|
186
|
+
* ## `"depth16unorm"`
|
|
187
|
+
*
|
|
188
|
+
* ## `"depth24plus"`
|
|
189
|
+
*
|
|
190
|
+
* ## `"depth24plus-stencil8"`
|
|
191
|
+
*
|
|
192
|
+
* ## `"depth32float"`
|
|
193
|
+
*
|
|
194
|
+
* ## `"depth32float-stencil8"`
|
|
195
|
+
*
|
|
196
|
+
* ## `"bc1-rgba-unorm"`
|
|
197
|
+
*
|
|
198
|
+
* ## `"bc1-rgba-unorm-srgb"`
|
|
199
|
+
*
|
|
200
|
+
* ## `"bc2-rgba-unorm"`
|
|
201
|
+
*
|
|
202
|
+
* ## `"bc2-rgba-unorm-srgb"`
|
|
203
|
+
*
|
|
204
|
+
* ## `"bc3-rgba-unorm"`
|
|
205
|
+
*
|
|
206
|
+
* ## `"bc3-rgba-unorm-srgb"`
|
|
207
|
+
*
|
|
208
|
+
* ## `"bc4-r-unorm"`
|
|
209
|
+
*
|
|
210
|
+
* ## `"bc4-r-snorm"`
|
|
211
|
+
*
|
|
212
|
+
* ## `"bc5-rg-unorm"`
|
|
213
|
+
*
|
|
214
|
+
* ## `"bc5-rg-snorm"`
|
|
215
|
+
*
|
|
216
|
+
* ## `"bc6h-rgb-ufloat"`
|
|
217
|
+
*
|
|
218
|
+
* ## `"bc6h-rgb-float"`
|
|
219
|
+
*
|
|
220
|
+
* ## `"bc7-rgba-unorm"`
|
|
221
|
+
*
|
|
222
|
+
* ## `"bc7-rgba-unorm-srgb"`
|
|
223
|
+
*
|
|
224
|
+
* ## `"etc2-rgb8unorm"`
|
|
225
|
+
*
|
|
226
|
+
* ## `"etc2-rgb8unorm-srgb"`
|
|
227
|
+
*
|
|
228
|
+
* ## `"etc2-rgb8a1unorm"`
|
|
229
|
+
*
|
|
230
|
+
* ## `"etc2-rgb8a1unorm-srgb"`
|
|
231
|
+
*
|
|
232
|
+
* ## `"etc2-rgba8unorm"`
|
|
233
|
+
*
|
|
234
|
+
* ## `"etc2-rgba8unorm-srgb"`
|
|
235
|
+
*
|
|
236
|
+
* ## `"eac-r11unorm"`
|
|
237
|
+
*
|
|
238
|
+
* ## `"eac-r11snorm"`
|
|
239
|
+
*
|
|
240
|
+
* ## `"eac-rg11unorm"`
|
|
241
|
+
*
|
|
242
|
+
* ## `"eac-rg11snorm"`
|
|
243
|
+
*
|
|
244
|
+
* ## `"astc4x4-unorm"`
|
|
245
|
+
*
|
|
246
|
+
* ## `"astc4x4-unorm-srgb"`
|
|
247
|
+
*
|
|
248
|
+
* ## `"astc5x4-unorm"`
|
|
249
|
+
*
|
|
250
|
+
* ## `"astc5x4-unorm-srgb"`
|
|
251
|
+
*
|
|
252
|
+
* ## `"astc5x5-unorm"`
|
|
253
|
+
*
|
|
254
|
+
* ## `"astc5x5-unorm-srgb"`
|
|
255
|
+
*
|
|
256
|
+
* ## `"astc6x5-unorm"`
|
|
257
|
+
*
|
|
258
|
+
* ## `"astc6x5-unorm-srgb"`
|
|
259
|
+
*
|
|
260
|
+
* ## `"astc6x6-unorm"`
|
|
261
|
+
*
|
|
262
|
+
* ## `"astc6x6-unorm-srgb"`
|
|
263
|
+
*
|
|
264
|
+
* ## `"astc8x5-unorm"`
|
|
265
|
+
*
|
|
266
|
+
* ## `"astc8x5-unorm-srgb"`
|
|
267
|
+
*
|
|
268
|
+
* ## `"astc8x6-unorm"`
|
|
269
|
+
*
|
|
270
|
+
* ## `"astc8x6-unorm-srgb"`
|
|
271
|
+
*
|
|
272
|
+
* ## `"astc8x8-unorm"`
|
|
273
|
+
*
|
|
274
|
+
* ## `"astc8x8-unorm-srgb"`
|
|
275
|
+
*
|
|
276
|
+
* ## `"astc10x5-unorm"`
|
|
277
|
+
*
|
|
278
|
+
* ## `"astc10x5-unorm-srgb"`
|
|
279
|
+
*
|
|
280
|
+
* ## `"astc10x6-unorm"`
|
|
281
|
+
*
|
|
282
|
+
* ## `"astc10x6-unorm-srgb"`
|
|
283
|
+
*
|
|
284
|
+
* ## `"astc10x8-unorm"`
|
|
285
|
+
*
|
|
286
|
+
* ## `"astc10x8-unorm-srgb"`
|
|
287
|
+
*
|
|
288
|
+
* ## `"astc10x10-unorm"`
|
|
289
|
+
*
|
|
290
|
+
* ## `"astc10x10-unorm-srgb"`
|
|
291
|
+
*
|
|
292
|
+
* ## `"astc12x10-unorm"`
|
|
293
|
+
*
|
|
294
|
+
* ## `"astc12x10-unorm-srgb"`
|
|
295
|
+
*
|
|
296
|
+
* ## `"astc12x12-unorm"`
|
|
297
|
+
*
|
|
298
|
+
* ## `"astc12x12-unorm-srgb"`
|
|
299
|
+
*/
|
|
300
|
+
export type GpuTextureFormat = 'r8unorm' | 'r8snorm' | 'r8uint' | 'r8sint' | 'r16uint' | 'r16sint' | 'r16float' | 'rg8unorm' | 'rg8snorm' | 'rg8uint' | 'rg8sint' | 'r32uint' | 'r32sint' | 'r32float' | 'rg16uint' | 'rg16sint' | 'rg16float' | 'rgba8unorm' | 'rgba8unorm-srgb' | 'rgba8snorm' | 'rgba8uint' | 'rgba8sint' | 'bgra8unorm' | 'bgra8unorm-srgb' | 'rgb9e5ufloat' | 'rgb10a2uint' | 'rgb10a2unorm' | 'rg11b10ufloat' | 'rg32uint' | 'rg32sint' | 'rg32float' | 'rgba16uint' | 'rgba16sint' | 'rgba16float' | 'rgba32uint' | 'rgba32sint' | 'rgba32float' | 'stencil8' | 'depth16unorm' | 'depth24plus' | 'depth24plus-stencil8' | 'depth32float' | 'depth32float-stencil8' | 'bc1-rgba-unorm' | 'bc1-rgba-unorm-srgb' | 'bc2-rgba-unorm' | 'bc2-rgba-unorm-srgb' | 'bc3-rgba-unorm' | 'bc3-rgba-unorm-srgb' | 'bc4-r-unorm' | 'bc4-r-snorm' | 'bc5-rg-unorm' | 'bc5-rg-snorm' | 'bc6h-rgb-ufloat' | 'bc6h-rgb-float' | 'bc7-rgba-unorm' | 'bc7-rgba-unorm-srgb' | 'etc2-rgb8unorm' | 'etc2-rgb8unorm-srgb' | 'etc2-rgb8a1unorm' | 'etc2-rgb8a1unorm-srgb' | 'etc2-rgba8unorm' | 'etc2-rgba8unorm-srgb' | 'eac-r11unorm' | 'eac-r11snorm' | 'eac-rg11unorm' | 'eac-rg11snorm' | 'astc4x4-unorm' | 'astc4x4-unorm-srgb' | 'astc5x4-unorm' | 'astc5x4-unorm-srgb' | 'astc5x5-unorm' | 'astc5x5-unorm-srgb' | 'astc6x5-unorm' | 'astc6x5-unorm-srgb' | 'astc6x6-unorm' | 'astc6x6-unorm-srgb' | 'astc8x5-unorm' | 'astc8x5-unorm-srgb' | 'astc8x6-unorm' | 'astc8x6-unorm-srgb' | 'astc8x8-unorm' | 'astc8x8-unorm-srgb' | 'astc10x5-unorm' | 'astc10x5-unorm-srgb' | 'astc10x6-unorm' | 'astc10x6-unorm-srgb' | 'astc10x8-unorm' | 'astc10x8-unorm-srgb' | 'astc10x10-unorm' | 'astc10x10-unorm-srgb' | 'astc12x10-unorm' | 'astc12x10-unorm-srgb' | 'astc12x12-unorm' | 'astc12x12-unorm-srgb';
|
|
301
|
+
/**
|
|
302
|
+
* # Variants
|
|
303
|
+
*
|
|
304
|
+
* ## `"clamp-to-edge"`
|
|
305
|
+
*
|
|
306
|
+
* ## `"repeat"`
|
|
307
|
+
*
|
|
308
|
+
* ## `"mirror-repeat"`
|
|
309
|
+
*/
|
|
310
|
+
export type GpuAddressMode = 'clamp-to-edge' | 'repeat' | 'mirror-repeat';
|
|
311
|
+
/**
|
|
312
|
+
* # Variants
|
|
313
|
+
*
|
|
314
|
+
* ## `"nearest"`
|
|
315
|
+
*
|
|
316
|
+
* ## `"linear"`
|
|
317
|
+
*/
|
|
318
|
+
export type GpuFilterMode = 'nearest' | 'linear';
|
|
319
|
+
/**
|
|
320
|
+
* # Variants
|
|
321
|
+
*
|
|
322
|
+
* ## `"nearest"`
|
|
323
|
+
*
|
|
324
|
+
* ## `"linear"`
|
|
325
|
+
*/
|
|
326
|
+
export type GpuMipmapFilterMode = 'nearest' | 'linear';
|
|
327
|
+
/**
|
|
328
|
+
* # Variants
|
|
329
|
+
*
|
|
330
|
+
* ## `"never"`
|
|
331
|
+
*
|
|
332
|
+
* ## `"less"`
|
|
333
|
+
*
|
|
334
|
+
* ## `"equal"`
|
|
335
|
+
*
|
|
336
|
+
* ## `"less-equal"`
|
|
337
|
+
*
|
|
338
|
+
* ## `"greater"`
|
|
339
|
+
*
|
|
340
|
+
* ## `"not-equal"`
|
|
341
|
+
*
|
|
342
|
+
* ## `"greater-equal"`
|
|
343
|
+
*
|
|
344
|
+
* ## `"always"`
|
|
345
|
+
*/
|
|
346
|
+
export type GpuCompareFunction = 'never' | 'less' | 'equal' | 'less-equal' | 'greater' | 'not-equal' | 'greater-equal' | 'always';
|
|
347
|
+
export interface GpuSamplerDescriptor {
|
|
348
|
+
addressModeU?: GpuAddressMode,
|
|
349
|
+
addressModeV?: GpuAddressMode,
|
|
350
|
+
addressModeW?: GpuAddressMode,
|
|
351
|
+
magFilter?: GpuFilterMode,
|
|
352
|
+
minFilter?: GpuFilterMode,
|
|
353
|
+
mipmapFilter?: GpuMipmapFilterMode,
|
|
354
|
+
lodMinClamp?: number,
|
|
355
|
+
lodMaxClamp?: number,
|
|
356
|
+
compare?: GpuCompareFunction,
|
|
357
|
+
maxAnisotropy?: number,
|
|
358
|
+
label?: string,
|
|
359
|
+
}
|
|
360
|
+
export type GpuShaderStageFlags = number;
|
|
361
|
+
/**
|
|
362
|
+
* # Variants
|
|
363
|
+
*
|
|
364
|
+
* ## `"uniform"`
|
|
365
|
+
*
|
|
366
|
+
* ## `"storage"`
|
|
367
|
+
*
|
|
368
|
+
* ## `"read-only-storage"`
|
|
369
|
+
*/
|
|
370
|
+
export type GpuBufferBindingType = 'uniform' | 'storage' | 'read-only-storage';
|
|
371
|
+
/**
|
|
372
|
+
* # Variants
|
|
373
|
+
*
|
|
374
|
+
* ## `"filtering"`
|
|
375
|
+
*
|
|
376
|
+
* ## `"non-filtering"`
|
|
377
|
+
*
|
|
378
|
+
* ## `"comparison"`
|
|
379
|
+
*/
|
|
380
|
+
export type GpuSamplerBindingType = 'filtering' | 'non-filtering' | 'comparison';
|
|
381
|
+
export interface GpuSamplerBindingLayout {
|
|
382
|
+
type?: GpuSamplerBindingType,
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* # Variants
|
|
386
|
+
*
|
|
387
|
+
* ## `"float"`
|
|
388
|
+
*
|
|
389
|
+
* ## `"unfilterable-float"`
|
|
390
|
+
*
|
|
391
|
+
* ## `"depth"`
|
|
392
|
+
*
|
|
393
|
+
* ## `"sint"`
|
|
394
|
+
*
|
|
395
|
+
* ## `"uint"`
|
|
396
|
+
*/
|
|
397
|
+
export type GpuTextureSampleType = 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';
|
|
398
|
+
export interface GpuTextureBindingLayout {
|
|
399
|
+
sampleType?: GpuTextureSampleType,
|
|
400
|
+
viewDimension?: GpuTextureViewDimension,
|
|
401
|
+
multisampled?: boolean,
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* # Variants
|
|
405
|
+
*
|
|
406
|
+
* ## `"write-only"`
|
|
407
|
+
*
|
|
408
|
+
* ## `"read-only"`
|
|
409
|
+
*
|
|
410
|
+
* ## `"read-write"`
|
|
411
|
+
*/
|
|
412
|
+
export type GpuStorageTextureAccess = 'write-only' | 'read-only' | 'read-write';
|
|
413
|
+
export interface GpuStorageTextureBindingLayout {
|
|
414
|
+
access?: GpuStorageTextureAccess,
|
|
415
|
+
format: GpuTextureFormat,
|
|
416
|
+
viewDimension?: GpuTextureViewDimension,
|
|
417
|
+
}
|
|
418
|
+
export interface GpuPipelineLayoutDescriptor {
|
|
419
|
+
bindGroupLayouts: Array<GpuBindGroupLayout | undefined>,
|
|
420
|
+
label?: string,
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* # Variants
|
|
424
|
+
*
|
|
425
|
+
* ## `"error"`
|
|
426
|
+
*
|
|
427
|
+
* ## `"warning"`
|
|
428
|
+
*
|
|
429
|
+
* ## `"info"`
|
|
430
|
+
*/
|
|
431
|
+
export type GpuCompilationMessageType = 'error' | 'warning' | 'info';
|
|
432
|
+
/**
|
|
433
|
+
* # Variants
|
|
434
|
+
*
|
|
435
|
+
* ## `"validation"`
|
|
436
|
+
*
|
|
437
|
+
* ## `"internal"`
|
|
438
|
+
*/
|
|
439
|
+
export type GpuPipelineErrorReason = 'validation' | 'internal';
|
|
440
|
+
export type GpuLayoutMode = GpuLayoutModeSpecific | GpuLayoutModeAuto;
|
|
441
|
+
export interface GpuLayoutModeSpecific {
|
|
442
|
+
tag: 'specific',
|
|
443
|
+
val: GpuPipelineLayout,
|
|
444
|
+
}
|
|
445
|
+
export interface GpuLayoutModeAuto {
|
|
446
|
+
tag: 'auto',
|
|
447
|
+
}
|
|
448
|
+
export interface GpuShaderModuleCompilationHint {
|
|
449
|
+
entryPoint: string,
|
|
450
|
+
layout?: GpuLayoutMode,
|
|
451
|
+
}
|
|
452
|
+
export interface GpuShaderModuleDescriptor {
|
|
453
|
+
code: string,
|
|
454
|
+
compilationHints?: Array<GpuShaderModuleCompilationHint>,
|
|
455
|
+
label?: string,
|
|
456
|
+
}
|
|
457
|
+
export interface GpuProgrammableStage {
|
|
458
|
+
module: GpuShaderModule,
|
|
459
|
+
entryPoint?: string,
|
|
460
|
+
constants?: RecordGpuPipelineConstantValue,
|
|
461
|
+
}
|
|
462
|
+
export type GpuPipelineConstantValue = number;
|
|
463
|
+
export interface GpuComputePipelineDescriptor {
|
|
464
|
+
compute: GpuProgrammableStage,
|
|
465
|
+
layout: GpuLayoutMode,
|
|
466
|
+
label?: string,
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* # Variants
|
|
470
|
+
*
|
|
471
|
+
* ## `"point-list"`
|
|
472
|
+
*
|
|
473
|
+
* ## `"line-list"`
|
|
474
|
+
*
|
|
475
|
+
* ## `"line-strip"`
|
|
476
|
+
*
|
|
477
|
+
* ## `"triangle-list"`
|
|
478
|
+
*
|
|
479
|
+
* ## `"triangle-strip"`
|
|
480
|
+
*/
|
|
481
|
+
export type GpuPrimitiveTopology = 'point-list' | 'line-list' | 'line-strip' | 'triangle-list' | 'triangle-strip';
|
|
482
|
+
/**
|
|
483
|
+
* # Variants
|
|
484
|
+
*
|
|
485
|
+
* ## `"ccw"`
|
|
486
|
+
*
|
|
487
|
+
* ## `"cw"`
|
|
488
|
+
*/
|
|
489
|
+
export type GpuFrontFace = 'ccw' | 'cw';
|
|
490
|
+
/**
|
|
491
|
+
* # Variants
|
|
492
|
+
*
|
|
493
|
+
* ## `"none"`
|
|
494
|
+
*
|
|
495
|
+
* ## `"front"`
|
|
496
|
+
*
|
|
497
|
+
* ## `"back"`
|
|
498
|
+
*/
|
|
499
|
+
export type GpuCullMode = 'none' | 'front' | 'back';
|
|
500
|
+
export type GpuColorWriteFlags = number;
|
|
501
|
+
/**
|
|
502
|
+
* # Variants
|
|
503
|
+
*
|
|
504
|
+
* ## `"zero"`
|
|
505
|
+
*
|
|
506
|
+
* ## `"one"`
|
|
507
|
+
*
|
|
508
|
+
* ## `"src"`
|
|
509
|
+
*
|
|
510
|
+
* ## `"one-minus-src"`
|
|
511
|
+
*
|
|
512
|
+
* ## `"src-alpha"`
|
|
513
|
+
*
|
|
514
|
+
* ## `"one-minus-src-alpha"`
|
|
515
|
+
*
|
|
516
|
+
* ## `"dst"`
|
|
517
|
+
*
|
|
518
|
+
* ## `"one-minus-dst"`
|
|
519
|
+
*
|
|
520
|
+
* ## `"dst-alpha"`
|
|
521
|
+
*
|
|
522
|
+
* ## `"one-minus-dst-alpha"`
|
|
523
|
+
*
|
|
524
|
+
* ## `"src-alpha-saturated"`
|
|
525
|
+
*
|
|
526
|
+
* ## `"constant"`
|
|
527
|
+
*
|
|
528
|
+
* ## `"one-minus-constant"`
|
|
529
|
+
*
|
|
530
|
+
* ## `"src1"`
|
|
531
|
+
*
|
|
532
|
+
* ## `"one-minus-src1"`
|
|
533
|
+
*
|
|
534
|
+
* ## `"src1-alpha"`
|
|
535
|
+
*
|
|
536
|
+
* ## `"one-minus-src1-alpha"`
|
|
537
|
+
*/
|
|
538
|
+
export type GpuBlendFactor = 'zero' | 'one' | 'src' | 'one-minus-src' | 'src-alpha' | 'one-minus-src-alpha' | 'dst' | 'one-minus-dst' | 'dst-alpha' | 'one-minus-dst-alpha' | 'src-alpha-saturated' | 'constant' | 'one-minus-constant' | 'src1' | 'one-minus-src1' | 'src1-alpha' | 'one-minus-src1-alpha';
|
|
539
|
+
/**
|
|
540
|
+
* # Variants
|
|
541
|
+
*
|
|
542
|
+
* ## `"add"`
|
|
543
|
+
*
|
|
544
|
+
* ## `"subtract"`
|
|
545
|
+
*
|
|
546
|
+
* ## `"reverse-subtract"`
|
|
547
|
+
*
|
|
548
|
+
* ## `"min"`
|
|
549
|
+
*
|
|
550
|
+
* ## `"max"`
|
|
551
|
+
*/
|
|
552
|
+
export type GpuBlendOperation = 'add' | 'subtract' | 'reverse-subtract' | 'min' | 'max';
|
|
553
|
+
export interface GpuBlendComponent {
|
|
554
|
+
operation?: GpuBlendOperation,
|
|
555
|
+
srcFactor?: GpuBlendFactor,
|
|
556
|
+
dstFactor?: GpuBlendFactor,
|
|
557
|
+
}
|
|
558
|
+
export interface GpuBlendState {
|
|
559
|
+
color: GpuBlendComponent,
|
|
560
|
+
alpha: GpuBlendComponent,
|
|
561
|
+
}
|
|
562
|
+
export interface GpuColorTargetState {
|
|
563
|
+
format: GpuTextureFormat,
|
|
564
|
+
blend?: GpuBlendState,
|
|
565
|
+
writeMask?: GpuColorWriteFlags,
|
|
566
|
+
}
|
|
567
|
+
export interface GpuFragmentState {
|
|
568
|
+
targets: Array<GpuColorTargetState | undefined>,
|
|
569
|
+
module: GpuShaderModule,
|
|
570
|
+
entryPoint?: string,
|
|
571
|
+
constants?: RecordGpuPipelineConstantValue,
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* # Variants
|
|
575
|
+
*
|
|
576
|
+
* ## `"keep"`
|
|
577
|
+
*
|
|
578
|
+
* ## `"zero"`
|
|
579
|
+
*
|
|
580
|
+
* ## `"replace"`
|
|
581
|
+
*
|
|
582
|
+
* ## `"invert"`
|
|
583
|
+
*
|
|
584
|
+
* ## `"increment-clamp"`
|
|
585
|
+
*
|
|
586
|
+
* ## `"decrement-clamp"`
|
|
587
|
+
*
|
|
588
|
+
* ## `"increment-wrap"`
|
|
589
|
+
*
|
|
590
|
+
* ## `"decrement-wrap"`
|
|
591
|
+
*/
|
|
592
|
+
export type GpuStencilOperation = 'keep' | 'zero' | 'replace' | 'invert' | 'increment-clamp' | 'decrement-clamp' | 'increment-wrap' | 'decrement-wrap';
|
|
593
|
+
export interface GpuStencilFaceState {
|
|
594
|
+
compare?: GpuCompareFunction,
|
|
595
|
+
failOp?: GpuStencilOperation,
|
|
596
|
+
depthFailOp?: GpuStencilOperation,
|
|
597
|
+
passOp?: GpuStencilOperation,
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* # Variants
|
|
601
|
+
*
|
|
602
|
+
* ## `"uint16"`
|
|
603
|
+
*
|
|
604
|
+
* ## `"uint32"`
|
|
605
|
+
*/
|
|
606
|
+
export type GpuIndexFormat = 'uint16' | 'uint32';
|
|
607
|
+
export interface GpuPrimitiveState {
|
|
608
|
+
topology?: GpuPrimitiveTopology,
|
|
609
|
+
stripIndexFormat?: GpuIndexFormat,
|
|
610
|
+
frontFace?: GpuFrontFace,
|
|
611
|
+
cullMode?: GpuCullMode,
|
|
612
|
+
unclippedDepth?: boolean,
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* # Variants
|
|
616
|
+
*
|
|
617
|
+
* ## `"uint8"`
|
|
618
|
+
*
|
|
619
|
+
* ## `"uint8x2"`
|
|
620
|
+
*
|
|
621
|
+
* ## `"uint8x4"`
|
|
622
|
+
*
|
|
623
|
+
* ## `"sint8"`
|
|
624
|
+
*
|
|
625
|
+
* ## `"sint8x2"`
|
|
626
|
+
*
|
|
627
|
+
* ## `"sint8x4"`
|
|
628
|
+
*
|
|
629
|
+
* ## `"unorm8"`
|
|
630
|
+
*
|
|
631
|
+
* ## `"unorm8x2"`
|
|
632
|
+
*
|
|
633
|
+
* ## `"unorm8x4"`
|
|
634
|
+
*
|
|
635
|
+
* ## `"snorm8"`
|
|
636
|
+
*
|
|
637
|
+
* ## `"snorm8x2"`
|
|
638
|
+
*
|
|
639
|
+
* ## `"snorm8x4"`
|
|
640
|
+
*
|
|
641
|
+
* ## `"uint16"`
|
|
642
|
+
*
|
|
643
|
+
* ## `"uint16x2"`
|
|
644
|
+
*
|
|
645
|
+
* ## `"uint16x4"`
|
|
646
|
+
*
|
|
647
|
+
* ## `"sint16"`
|
|
648
|
+
*
|
|
649
|
+
* ## `"sint16x2"`
|
|
650
|
+
*
|
|
651
|
+
* ## `"sint16x4"`
|
|
652
|
+
*
|
|
653
|
+
* ## `"unorm16"`
|
|
654
|
+
*
|
|
655
|
+
* ## `"unorm16x2"`
|
|
656
|
+
*
|
|
657
|
+
* ## `"unorm16x4"`
|
|
658
|
+
*
|
|
659
|
+
* ## `"snorm16"`
|
|
660
|
+
*
|
|
661
|
+
* ## `"snorm16x2"`
|
|
662
|
+
*
|
|
663
|
+
* ## `"snorm16x4"`
|
|
664
|
+
*
|
|
665
|
+
* ## `"float16"`
|
|
666
|
+
*
|
|
667
|
+
* ## `"float16x2"`
|
|
668
|
+
*
|
|
669
|
+
* ## `"float16x4"`
|
|
670
|
+
*
|
|
671
|
+
* ## `"float32"`
|
|
672
|
+
*
|
|
673
|
+
* ## `"float32x2"`
|
|
674
|
+
*
|
|
675
|
+
* ## `"float32x3"`
|
|
676
|
+
*
|
|
677
|
+
* ## `"float32x4"`
|
|
678
|
+
*
|
|
679
|
+
* ## `"uint32"`
|
|
680
|
+
*
|
|
681
|
+
* ## `"uint32x2"`
|
|
682
|
+
*
|
|
683
|
+
* ## `"uint32x3"`
|
|
684
|
+
*
|
|
685
|
+
* ## `"uint32x4"`
|
|
686
|
+
*
|
|
687
|
+
* ## `"sint32"`
|
|
688
|
+
*
|
|
689
|
+
* ## `"sint32x2"`
|
|
690
|
+
*
|
|
691
|
+
* ## `"sint32x3"`
|
|
692
|
+
*
|
|
693
|
+
* ## `"sint32x4"`
|
|
694
|
+
*
|
|
695
|
+
* ## `"unorm1010102"`
|
|
696
|
+
*
|
|
697
|
+
* ## `"unorm8x4-bgra"`
|
|
698
|
+
*/
|
|
699
|
+
export type GpuVertexFormat = 'uint8' | 'uint8x2' | 'uint8x4' | 'sint8' | 'sint8x2' | 'sint8x4' | 'unorm8' | 'unorm8x2' | 'unorm8x4' | 'snorm8' | 'snorm8x2' | 'snorm8x4' | 'uint16' | 'uint16x2' | 'uint16x4' | 'sint16' | 'sint16x2' | 'sint16x4' | 'unorm16' | 'unorm16x2' | 'unorm16x4' | 'snorm16' | 'snorm16x2' | 'snorm16x4' | 'float16' | 'float16x2' | 'float16x4' | 'float32' | 'float32x2' | 'float32x3' | 'float32x4' | 'uint32' | 'uint32x2' | 'uint32x3' | 'uint32x4' | 'sint32' | 'sint32x2' | 'sint32x3' | 'sint32x4' | 'unorm1010102' | 'unorm8x4-bgra';
|
|
700
|
+
/**
|
|
701
|
+
* # Variants
|
|
702
|
+
*
|
|
703
|
+
* ## `"vertex"`
|
|
704
|
+
*
|
|
705
|
+
* ## `"instance"`
|
|
706
|
+
*/
|
|
707
|
+
export type GpuVertexStepMode = 'vertex' | 'instance';
|
|
708
|
+
export interface GpuCommandBufferDescriptor {
|
|
709
|
+
label?: string,
|
|
710
|
+
}
|
|
711
|
+
export interface GpuCommandEncoderDescriptor {
|
|
712
|
+
label?: string,
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* # Variants
|
|
716
|
+
*
|
|
717
|
+
* ## `"load"`
|
|
718
|
+
*
|
|
719
|
+
* ## `"clear"`
|
|
720
|
+
*/
|
|
721
|
+
export type GpuLoadOp = 'load' | 'clear';
|
|
722
|
+
/**
|
|
723
|
+
* # Variants
|
|
724
|
+
*
|
|
725
|
+
* ## `"store"`
|
|
726
|
+
*
|
|
727
|
+
* ## `"discard"`
|
|
728
|
+
*/
|
|
729
|
+
export type GpuStoreOp = 'store' | 'discard';
|
|
730
|
+
export interface GpuRenderBundleDescriptor {
|
|
731
|
+
label?: string,
|
|
732
|
+
}
|
|
733
|
+
export interface GpuQueueDescriptor {
|
|
734
|
+
label?: string,
|
|
735
|
+
}
|
|
736
|
+
export interface GpuDeviceDescriptor {
|
|
737
|
+
requiredFeatures?: Array<GpuFeatureName>,
|
|
738
|
+
requiredLimits?: RecordOptionGpuSize64,
|
|
739
|
+
defaultQueue?: GpuQueueDescriptor,
|
|
740
|
+
label?: string,
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* # Variants
|
|
744
|
+
*
|
|
745
|
+
* ## `"occlusion"`
|
|
746
|
+
*
|
|
747
|
+
* ## `"timestamp"`
|
|
748
|
+
*/
|
|
749
|
+
export type GpuQueryType = 'occlusion' | 'timestamp';
|
|
750
|
+
/**
|
|
751
|
+
* # Variants
|
|
752
|
+
*
|
|
753
|
+
* ## `"opaque"`
|
|
754
|
+
*
|
|
755
|
+
* ## `"premultiplied"`
|
|
756
|
+
*/
|
|
757
|
+
export type GpuCanvasAlphaMode = 'opaque' | 'premultiplied';
|
|
758
|
+
/**
|
|
759
|
+
* # Variants
|
|
760
|
+
*
|
|
761
|
+
* ## `"standard"`
|
|
762
|
+
*
|
|
763
|
+
* ## `"extended"`
|
|
764
|
+
*/
|
|
765
|
+
export type GpuCanvasToneMappingMode = 'standard' | 'extended';
|
|
766
|
+
export interface GpuCanvasToneMapping {
|
|
767
|
+
mode?: GpuCanvasToneMappingMode,
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* # Variants
|
|
771
|
+
*
|
|
772
|
+
* ## `"unknown"`
|
|
773
|
+
*
|
|
774
|
+
* ## `"destroyed"`
|
|
775
|
+
*/
|
|
776
|
+
export type GpuDeviceLostReason = 'unknown' | 'destroyed';
|
|
777
|
+
/**
|
|
778
|
+
* # Variants
|
|
779
|
+
*
|
|
780
|
+
* ## `"validation"`
|
|
781
|
+
*
|
|
782
|
+
* ## `"out-of-memory"`
|
|
783
|
+
*
|
|
784
|
+
* ## `"internal"`
|
|
785
|
+
*/
|
|
786
|
+
export type GpuErrorFilter = 'validation' | 'out-of-memory' | 'internal';
|
|
787
|
+
export type GpuBufferDynamicOffset = number;
|
|
788
|
+
export type GpuStencilValue = number;
|
|
789
|
+
export interface GpuRenderPassDepthStencilAttachment {
|
|
790
|
+
view: GpuTextureView,
|
|
791
|
+
depthClearValue?: number,
|
|
792
|
+
depthLoadOp?: GpuLoadOp,
|
|
793
|
+
depthStoreOp?: GpuStoreOp,
|
|
794
|
+
depthReadOnly?: boolean,
|
|
795
|
+
stencilClearValue?: GpuStencilValue,
|
|
796
|
+
stencilLoadOp?: GpuLoadOp,
|
|
797
|
+
stencilStoreOp?: GpuStoreOp,
|
|
798
|
+
stencilReadOnly?: boolean,
|
|
799
|
+
}
|
|
800
|
+
export type GpuSampleMask = number;
|
|
801
|
+
export type GpuDepthBias = number;
|
|
802
|
+
export interface GpuDepthStencilState {
|
|
803
|
+
format: GpuTextureFormat,
|
|
804
|
+
depthWriteEnabled?: boolean,
|
|
805
|
+
depthCompare?: GpuCompareFunction,
|
|
806
|
+
stencilFront?: GpuStencilFaceState,
|
|
807
|
+
stencilBack?: GpuStencilFaceState,
|
|
808
|
+
stencilReadMask?: GpuStencilValue,
|
|
809
|
+
stencilWriteMask?: GpuStencilValue,
|
|
810
|
+
depthBias?: GpuDepthBias,
|
|
811
|
+
depthBiasSlopeScale?: number,
|
|
812
|
+
depthBiasClamp?: number,
|
|
813
|
+
}
|
|
814
|
+
export type GpuSize64 = bigint;
|
|
815
|
+
export interface GpuBufferDescriptor {
|
|
816
|
+
size: GpuSize64,
|
|
817
|
+
usage: GpuBufferUsageFlags,
|
|
818
|
+
mappedAtCreation?: boolean,
|
|
819
|
+
label?: string,
|
|
820
|
+
}
|
|
821
|
+
export interface GpuBufferBindingLayout {
|
|
822
|
+
type?: GpuBufferBindingType,
|
|
823
|
+
hasDynamicOffset?: boolean,
|
|
824
|
+
minBindingSize?: GpuSize64,
|
|
825
|
+
}
|
|
826
|
+
export interface GpuBufferBinding {
|
|
827
|
+
buffer: GpuBuffer,
|
|
828
|
+
offset?: GpuSize64,
|
|
829
|
+
size?: GpuSize64,
|
|
830
|
+
}
|
|
831
|
+
export type GpuBindingResource = GpuBindingResourceGpuBufferBinding | GpuBindingResourceGpuSampler | GpuBindingResourceGpuTextureView;
|
|
832
|
+
export interface GpuBindingResourceGpuBufferBinding {
|
|
833
|
+
tag: 'gpu-buffer-binding',
|
|
834
|
+
val: GpuBufferBinding,
|
|
835
|
+
}
|
|
836
|
+
export interface GpuBindingResourceGpuSampler {
|
|
837
|
+
tag: 'gpu-sampler',
|
|
838
|
+
val: GpuSampler,
|
|
839
|
+
}
|
|
840
|
+
export interface GpuBindingResourceGpuTextureView {
|
|
841
|
+
tag: 'gpu-texture-view',
|
|
842
|
+
val: GpuTextureView,
|
|
843
|
+
}
|
|
844
|
+
export type GpuIntegerCoordinate = number;
|
|
845
|
+
export interface GpuTextureViewDescriptor {
|
|
846
|
+
format?: GpuTextureFormat,
|
|
847
|
+
dimension?: GpuTextureViewDimension,
|
|
848
|
+
usage?: GpuTextureUsageFlags,
|
|
849
|
+
aspect?: GpuTextureAspect,
|
|
850
|
+
baseMipLevel?: GpuIntegerCoordinate,
|
|
851
|
+
mipLevelCount?: GpuIntegerCoordinate,
|
|
852
|
+
baseArrayLayer?: GpuIntegerCoordinate,
|
|
853
|
+
arrayLayerCount?: GpuIntegerCoordinate,
|
|
854
|
+
label?: string,
|
|
855
|
+
}
|
|
856
|
+
export type GpuIndex32 = number;
|
|
857
|
+
export interface GpuBindGroupLayoutEntry {
|
|
858
|
+
binding: GpuIndex32,
|
|
859
|
+
visibility: GpuShaderStageFlags,
|
|
860
|
+
buffer?: GpuBufferBindingLayout,
|
|
861
|
+
sampler?: GpuSamplerBindingLayout,
|
|
862
|
+
texture?: GpuTextureBindingLayout,
|
|
863
|
+
storageTexture?: GpuStorageTextureBindingLayout,
|
|
864
|
+
}
|
|
865
|
+
export interface GpuBindGroupLayoutDescriptor {
|
|
866
|
+
entries: Array<GpuBindGroupLayoutEntry>,
|
|
867
|
+
label?: string,
|
|
868
|
+
}
|
|
869
|
+
export interface GpuBindGroupEntry {
|
|
870
|
+
binding: GpuIndex32,
|
|
871
|
+
resource: GpuBindingResource,
|
|
872
|
+
}
|
|
873
|
+
export interface GpuBindGroupDescriptor {
|
|
874
|
+
layout: GpuBindGroupLayout,
|
|
875
|
+
entries: Array<GpuBindGroupEntry>,
|
|
876
|
+
label?: string,
|
|
877
|
+
}
|
|
878
|
+
export interface GpuVertexAttribute {
|
|
879
|
+
format: GpuVertexFormat,
|
|
880
|
+
offset: GpuSize64,
|
|
881
|
+
shaderLocation: GpuIndex32,
|
|
882
|
+
}
|
|
883
|
+
export interface GpuVertexBufferLayout {
|
|
884
|
+
arrayStride: GpuSize64,
|
|
885
|
+
stepMode?: GpuVertexStepMode,
|
|
886
|
+
attributes: Array<GpuVertexAttribute>,
|
|
887
|
+
}
|
|
888
|
+
export interface GpuVertexState {
|
|
889
|
+
buffers?: Array<GpuVertexBufferLayout | undefined>,
|
|
890
|
+
module: GpuShaderModule,
|
|
891
|
+
entryPoint?: string,
|
|
892
|
+
constants?: RecordGpuPipelineConstantValue,
|
|
893
|
+
}
|
|
894
|
+
export type GpuSize32 = number;
|
|
895
|
+
export interface GpuMultisampleState {
|
|
896
|
+
count?: GpuSize32,
|
|
897
|
+
mask?: GpuSampleMask,
|
|
898
|
+
alphaToCoverageEnabled?: boolean,
|
|
899
|
+
}
|
|
900
|
+
export interface GpuRenderPipelineDescriptor {
|
|
901
|
+
vertex: GpuVertexState,
|
|
902
|
+
primitive?: GpuPrimitiveState,
|
|
903
|
+
depthStencil?: GpuDepthStencilState,
|
|
904
|
+
multisample?: GpuMultisampleState,
|
|
905
|
+
fragment?: GpuFragmentState,
|
|
906
|
+
layout: GpuLayoutMode,
|
|
907
|
+
label?: string,
|
|
908
|
+
}
|
|
909
|
+
export interface GpuTexelCopyBufferLayout {
|
|
910
|
+
offset?: GpuSize64,
|
|
911
|
+
bytesPerRow?: GpuSize32,
|
|
912
|
+
rowsPerImage?: GpuSize32,
|
|
913
|
+
}
|
|
914
|
+
export interface GpuTexelCopyBufferInfo {
|
|
915
|
+
buffer: GpuBuffer,
|
|
916
|
+
offset?: GpuSize64,
|
|
917
|
+
bytesPerRow?: GpuSize32,
|
|
918
|
+
rowsPerImage?: GpuSize32,
|
|
919
|
+
}
|
|
920
|
+
export interface GpuComputePassTimestampWrites {
|
|
921
|
+
querySet: GpuQuerySet,
|
|
922
|
+
beginningOfPassWriteIndex?: GpuSize32,
|
|
923
|
+
endOfPassWriteIndex?: GpuSize32,
|
|
924
|
+
}
|
|
925
|
+
export interface GpuComputePassDescriptor {
|
|
926
|
+
timestampWrites?: GpuComputePassTimestampWrites,
|
|
927
|
+
label?: string,
|
|
928
|
+
}
|
|
929
|
+
export interface GpuRenderPassTimestampWrites {
|
|
930
|
+
querySet: GpuQuerySet,
|
|
931
|
+
beginningOfPassWriteIndex?: GpuSize32,
|
|
932
|
+
endOfPassWriteIndex?: GpuSize32,
|
|
933
|
+
}
|
|
934
|
+
export interface GpuRenderBundleEncoderDescriptor {
|
|
935
|
+
depthReadOnly?: boolean,
|
|
936
|
+
stencilReadOnly?: boolean,
|
|
937
|
+
colorFormats: Array<GpuTextureFormat | undefined>,
|
|
938
|
+
depthStencilFormat?: GpuTextureFormat,
|
|
939
|
+
sampleCount?: GpuSize32,
|
|
940
|
+
label?: string,
|
|
941
|
+
}
|
|
942
|
+
export interface GpuQuerySetDescriptor {
|
|
943
|
+
type: GpuQueryType,
|
|
944
|
+
count: GpuSize32,
|
|
945
|
+
label?: string,
|
|
946
|
+
}
|
|
947
|
+
export type GpuSignedOffset32 = number;
|
|
948
|
+
export type GpuSize64Out = bigint;
|
|
949
|
+
export type GpuIntegerCoordinateOut = number;
|
|
950
|
+
export type GpuSize32Out = number;
|
|
951
|
+
export type GpuFlagsConstant = number;
|
|
952
|
+
export interface GpuColor {
|
|
953
|
+
r: number,
|
|
954
|
+
g: number,
|
|
955
|
+
b: number,
|
|
956
|
+
a: number,
|
|
957
|
+
}
|
|
958
|
+
export interface GpuRenderPassColorAttachment {
|
|
959
|
+
view: GpuTextureView,
|
|
960
|
+
depthSlice?: GpuIntegerCoordinate,
|
|
961
|
+
resolveTarget?: GpuTextureView,
|
|
962
|
+
clearValue?: GpuColor,
|
|
963
|
+
loadOp: GpuLoadOp,
|
|
964
|
+
storeOp: GpuStoreOp,
|
|
965
|
+
}
|
|
966
|
+
export interface GpuRenderPassDescriptor {
|
|
967
|
+
colorAttachments: Array<GpuRenderPassColorAttachment | undefined>,
|
|
968
|
+
depthStencilAttachment?: GpuRenderPassDepthStencilAttachment,
|
|
969
|
+
occlusionQuerySet?: GpuQuerySet,
|
|
970
|
+
timestampWrites?: GpuRenderPassTimestampWrites,
|
|
971
|
+
maxDrawCount?: GpuSize64,
|
|
972
|
+
label?: string,
|
|
973
|
+
}
|
|
974
|
+
export interface GpuOrigin3D {
|
|
975
|
+
x?: GpuIntegerCoordinate,
|
|
976
|
+
y?: GpuIntegerCoordinate,
|
|
977
|
+
z?: GpuIntegerCoordinate,
|
|
978
|
+
}
|
|
979
|
+
export interface GpuTexelCopyTextureInfo {
|
|
980
|
+
texture: GpuTexture,
|
|
981
|
+
mipLevel?: GpuIntegerCoordinate,
|
|
982
|
+
origin?: GpuOrigin3D,
|
|
983
|
+
aspect?: GpuTextureAspect,
|
|
984
|
+
}
|
|
985
|
+
export interface GpuExtent3D {
|
|
986
|
+
width: GpuIntegerCoordinate,
|
|
987
|
+
height?: GpuIntegerCoordinate,
|
|
988
|
+
depthOrArrayLayers?: GpuIntegerCoordinate,
|
|
989
|
+
}
|
|
990
|
+
export interface GpuTextureDescriptor {
|
|
991
|
+
size: GpuExtent3D,
|
|
992
|
+
mipLevelCount?: GpuIntegerCoordinate,
|
|
993
|
+
sampleCount?: GpuSize32,
|
|
994
|
+
dimension?: GpuTextureDimension,
|
|
995
|
+
format: GpuTextureFormat,
|
|
996
|
+
usage: GpuTextureUsageFlags,
|
|
997
|
+
viewFormats?: Array<GpuTextureFormat>,
|
|
998
|
+
label?: string,
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* # Variants
|
|
1002
|
+
*
|
|
1003
|
+
* ## `"srgb"`
|
|
1004
|
+
*
|
|
1005
|
+
* ## `"display-p3"`
|
|
1006
|
+
*/
|
|
1007
|
+
export type PredefinedColorSpace = 'srgb' | 'display-p3';
|
|
1008
|
+
export interface GpuCanvasConfiguration {
|
|
1009
|
+
device: GpuDevice,
|
|
1010
|
+
format: GpuTextureFormat,
|
|
1011
|
+
usage?: GpuTextureUsageFlags,
|
|
1012
|
+
viewFormats?: Array<GpuTextureFormat>,
|
|
1013
|
+
colorSpace?: PredefinedColorSpace,
|
|
1014
|
+
toneMapping?: GpuCanvasToneMapping,
|
|
1015
|
+
alphaMode?: GpuCanvasAlphaMode,
|
|
1016
|
+
}
|
|
1017
|
+
export interface GpuCopyExternalImageDestInfo {
|
|
1018
|
+
colorSpace?: PredefinedColorSpace,
|
|
1019
|
+
premultipliedAlpha?: boolean,
|
|
1020
|
+
texture: GpuTexture,
|
|
1021
|
+
mipLevel?: GpuIntegerCoordinate,
|
|
1022
|
+
origin?: GpuOrigin3D,
|
|
1023
|
+
aspect?: GpuTextureAspect,
|
|
1024
|
+
}
|
|
1025
|
+
export interface GpuCanvasConfigurationOwned {
|
|
1026
|
+
device: GpuDevice,
|
|
1027
|
+
format: GpuTextureFormat,
|
|
1028
|
+
usage?: GpuTextureUsageFlags,
|
|
1029
|
+
viewFormats?: Array<GpuTextureFormat>,
|
|
1030
|
+
colorSpace?: PredefinedColorSpace,
|
|
1031
|
+
toneMapping?: GpuCanvasToneMapping,
|
|
1032
|
+
alphaMode?: GpuCanvasAlphaMode,
|
|
1033
|
+
}
|
|
1034
|
+
export type GpuErrorKind = GpuErrorKindValidationError | GpuErrorKindOutOfMemoryError | GpuErrorKindInternalError;
|
|
1035
|
+
export interface GpuErrorKindValidationError {
|
|
1036
|
+
tag: 'validation-error',
|
|
1037
|
+
}
|
|
1038
|
+
export interface GpuErrorKindOutOfMemoryError {
|
|
1039
|
+
tag: 'out-of-memory-error',
|
|
1040
|
+
}
|
|
1041
|
+
export interface GpuErrorKindInternalError {
|
|
1042
|
+
tag: 'internal-error',
|
|
1043
|
+
}
|
|
1044
|
+
export type RequestDeviceErrorKind = RequestDeviceErrorKindTypeError | RequestDeviceErrorKindOperationError;
|
|
1045
|
+
export interface RequestDeviceErrorKindTypeError {
|
|
1046
|
+
tag: 'type-error',
|
|
1047
|
+
}
|
|
1048
|
+
export interface RequestDeviceErrorKindOperationError {
|
|
1049
|
+
tag: 'operation-error',
|
|
1050
|
+
}
|
|
1051
|
+
export interface RequestDeviceError {
|
|
1052
|
+
kind: RequestDeviceErrorKind,
|
|
1053
|
+
message: string,
|
|
1054
|
+
}
|
|
1055
|
+
export type CreatePipelineErrorKind = CreatePipelineErrorKindGpuPipelineError;
|
|
1056
|
+
export interface CreatePipelineErrorKindGpuPipelineError {
|
|
1057
|
+
tag: 'gpu-pipeline-error',
|
|
1058
|
+
val: GpuPipelineErrorReason,
|
|
1059
|
+
}
|
|
1060
|
+
export interface CreatePipelineError {
|
|
1061
|
+
kind: CreatePipelineErrorKind,
|
|
1062
|
+
message: string,
|
|
1063
|
+
}
|
|
1064
|
+
export type CreateQuerySetErrorKind = CreateQuerySetErrorKindTypeError;
|
|
1065
|
+
export interface CreateQuerySetErrorKindTypeError {
|
|
1066
|
+
tag: 'type-error',
|
|
1067
|
+
}
|
|
1068
|
+
export interface CreateQuerySetError {
|
|
1069
|
+
kind: CreateQuerySetErrorKind,
|
|
1070
|
+
message: string,
|
|
1071
|
+
}
|
|
1072
|
+
export type PopErrorScopeErrorKind = PopErrorScopeErrorKindOperationError;
|
|
1073
|
+
export interface PopErrorScopeErrorKindOperationError {
|
|
1074
|
+
tag: 'operation-error',
|
|
1075
|
+
}
|
|
1076
|
+
export interface PopErrorScopeError {
|
|
1077
|
+
kind: PopErrorScopeErrorKind,
|
|
1078
|
+
message: string,
|
|
1079
|
+
}
|
|
1080
|
+
export type MapAsyncErrorKind = MapAsyncErrorKindOperationError | MapAsyncErrorKindRangeError | MapAsyncErrorKindAbortError;
|
|
1081
|
+
export interface MapAsyncErrorKindOperationError {
|
|
1082
|
+
tag: 'operation-error',
|
|
1083
|
+
}
|
|
1084
|
+
export interface MapAsyncErrorKindRangeError {
|
|
1085
|
+
tag: 'range-error',
|
|
1086
|
+
}
|
|
1087
|
+
export interface MapAsyncErrorKindAbortError {
|
|
1088
|
+
tag: 'abort-error',
|
|
1089
|
+
}
|
|
1090
|
+
export interface MapAsyncError {
|
|
1091
|
+
kind: MapAsyncErrorKind,
|
|
1092
|
+
message: string,
|
|
1093
|
+
}
|
|
1094
|
+
export type GetMappedRangeErrorKind = GetMappedRangeErrorKindOperationError | GetMappedRangeErrorKindRangeError | GetMappedRangeErrorKindTypeError;
|
|
1095
|
+
export interface GetMappedRangeErrorKindOperationError {
|
|
1096
|
+
tag: 'operation-error',
|
|
1097
|
+
}
|
|
1098
|
+
export interface GetMappedRangeErrorKindRangeError {
|
|
1099
|
+
tag: 'range-error',
|
|
1100
|
+
}
|
|
1101
|
+
export interface GetMappedRangeErrorKindTypeError {
|
|
1102
|
+
tag: 'type-error',
|
|
1103
|
+
}
|
|
1104
|
+
export interface GetMappedRangeError {
|
|
1105
|
+
kind: GetMappedRangeErrorKind,
|
|
1106
|
+
message: string,
|
|
1107
|
+
}
|
|
1108
|
+
export type UnmapErrorKind = UnmapErrorKindAbortError;
|
|
1109
|
+
export interface UnmapErrorKindAbortError {
|
|
1110
|
+
tag: 'abort-error',
|
|
1111
|
+
}
|
|
1112
|
+
export interface UnmapError {
|
|
1113
|
+
kind: UnmapErrorKind,
|
|
1114
|
+
message: string,
|
|
1115
|
+
}
|
|
1116
|
+
export type SetBindGroupErrorKind = SetBindGroupErrorKindRangeError;
|
|
1117
|
+
export interface SetBindGroupErrorKindRangeError {
|
|
1118
|
+
tag: 'range-error',
|
|
1119
|
+
}
|
|
1120
|
+
export interface SetBindGroupError {
|
|
1121
|
+
kind: SetBindGroupErrorKind,
|
|
1122
|
+
message: string,
|
|
1123
|
+
}
|
|
1124
|
+
export type WriteBufferErrorKind = WriteBufferErrorKindOperationError;
|
|
1125
|
+
export interface WriteBufferErrorKindOperationError {
|
|
1126
|
+
tag: 'operation-error',
|
|
1127
|
+
}
|
|
1128
|
+
export interface WriteBufferError {
|
|
1129
|
+
kind: WriteBufferErrorKind,
|
|
1130
|
+
message: string,
|
|
1131
|
+
}
|
|
1132
|
+
export type Option<T> = { tag: 'none' } | { tag: 'some', val: T };
|
|
1133
|
+
|
|
1134
|
+
export class Gpu {
|
|
1135
|
+
/**
|
|
1136
|
+
* This type does not have a public constructor.
|
|
1137
|
+
*/
|
|
1138
|
+
private constructor();
|
|
1139
|
+
requestAdapter(options: GpuRequestAdapterOptions | undefined): GpuAdapter | undefined;
|
|
1140
|
+
getPreferredCanvasFormat(): GpuTextureFormat;
|
|
1141
|
+
wgslLanguageFeatures(): WgslLanguageFeatures;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
export class GpuAdapter {
|
|
1145
|
+
/**
|
|
1146
|
+
* This type does not have a public constructor.
|
|
1147
|
+
*/
|
|
1148
|
+
private constructor();
|
|
1149
|
+
features(): GpuSupportedFeatures;
|
|
1150
|
+
limits(): GpuSupportedLimits;
|
|
1151
|
+
info(): GpuAdapterInfo;
|
|
1152
|
+
isFallbackAdapter(): boolean;
|
|
1153
|
+
requestDevice(descriptor: GpuDeviceDescriptor | undefined): GpuDevice;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export class GpuAdapterInfo {
|
|
1157
|
+
/**
|
|
1158
|
+
* This type does not have a public constructor.
|
|
1159
|
+
*/
|
|
1160
|
+
private constructor();
|
|
1161
|
+
vendor(): string;
|
|
1162
|
+
architecture(): string;
|
|
1163
|
+
device(): string;
|
|
1164
|
+
description(): string;
|
|
1165
|
+
subgroupMinSize(): number;
|
|
1166
|
+
subgroupMaxSize(): number;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
export class GpuBindGroup {
|
|
1170
|
+
/**
|
|
1171
|
+
* This type does not have a public constructor.
|
|
1172
|
+
*/
|
|
1173
|
+
private constructor();
|
|
1174
|
+
label(): string;
|
|
1175
|
+
setLabel(label: string): void;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
export class GpuBindGroupLayout {
|
|
1179
|
+
/**
|
|
1180
|
+
* This type does not have a public constructor.
|
|
1181
|
+
*/
|
|
1182
|
+
private constructor();
|
|
1183
|
+
label(): string;
|
|
1184
|
+
setLabel(label: string): void;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
export class GpuBuffer {
|
|
1188
|
+
/**
|
|
1189
|
+
* This type does not have a public constructor.
|
|
1190
|
+
*/
|
|
1191
|
+
private constructor();
|
|
1192
|
+
size(): GpuSize64Out;
|
|
1193
|
+
usage(): GpuFlagsConstant;
|
|
1194
|
+
mapState(): GpuBufferMapState;
|
|
1195
|
+
mapAsync(mode: GpuMapModeFlags, offset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1196
|
+
getMappedRangeGetWithCopy(offset: GpuSize64 | undefined, size: GpuSize64 | undefined): Uint8Array;
|
|
1197
|
+
unmap(): void;
|
|
1198
|
+
destroy(): void;
|
|
1199
|
+
label(): string;
|
|
1200
|
+
setLabel(label: string): void;
|
|
1201
|
+
getMappedRangeSetWithCopy(data: Uint8Array, offset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
export class GpuBufferUsage {
|
|
1205
|
+
/**
|
|
1206
|
+
* This type does not have a public constructor.
|
|
1207
|
+
*/
|
|
1208
|
+
private constructor();
|
|
1209
|
+
static mapRead(): GpuFlagsConstant;
|
|
1210
|
+
static mapWrite(): GpuFlagsConstant;
|
|
1211
|
+
static copySrc(): GpuFlagsConstant;
|
|
1212
|
+
static copyDst(): GpuFlagsConstant;
|
|
1213
|
+
static index(): GpuFlagsConstant;
|
|
1214
|
+
static vertex(): GpuFlagsConstant;
|
|
1215
|
+
static uniform(): GpuFlagsConstant;
|
|
1216
|
+
static storage(): GpuFlagsConstant;
|
|
1217
|
+
static indirect(): GpuFlagsConstant;
|
|
1218
|
+
static queryResolve(): GpuFlagsConstant;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
export class GpuCanvasContext {
|
|
1222
|
+
/**
|
|
1223
|
+
* This type does not have a public constructor.
|
|
1224
|
+
*/
|
|
1225
|
+
private constructor();
|
|
1226
|
+
configure(configuration: GpuCanvasConfiguration): void;
|
|
1227
|
+
unconfigure(): void;
|
|
1228
|
+
getConfiguration(): GpuCanvasConfigurationOwned | undefined;
|
|
1229
|
+
getCurrentTexture(): GpuTexture;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
export class GpuColorWrite {
|
|
1233
|
+
/**
|
|
1234
|
+
* This type does not have a public constructor.
|
|
1235
|
+
*/
|
|
1236
|
+
private constructor();
|
|
1237
|
+
static red(): GpuFlagsConstant;
|
|
1238
|
+
static green(): GpuFlagsConstant;
|
|
1239
|
+
static blue(): GpuFlagsConstant;
|
|
1240
|
+
static alpha(): GpuFlagsConstant;
|
|
1241
|
+
static all(): GpuFlagsConstant;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
export class GpuCommandBuffer {
|
|
1245
|
+
/**
|
|
1246
|
+
* This type does not have a public constructor.
|
|
1247
|
+
*/
|
|
1248
|
+
private constructor();
|
|
1249
|
+
label(): string;
|
|
1250
|
+
setLabel(label: string): void;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
export class GpuCommandEncoder {
|
|
1254
|
+
/**
|
|
1255
|
+
* This type does not have a public constructor.
|
|
1256
|
+
*/
|
|
1257
|
+
private constructor();
|
|
1258
|
+
beginRenderPass(descriptor: GpuRenderPassDescriptor): GpuRenderPassEncoder;
|
|
1259
|
+
beginComputePass(descriptor: GpuComputePassDescriptor | undefined): GpuComputePassEncoder;
|
|
1260
|
+
copyBufferToBuffer(source: GpuBuffer, sourceOffset: GpuSize64, destination: GpuBuffer, destinationOffset: GpuSize64, size: GpuSize64): void;
|
|
1261
|
+
copyBufferToTexture(source: GpuTexelCopyBufferInfo, destination: GpuTexelCopyTextureInfo, copySize: GpuExtent3D): void;
|
|
1262
|
+
copyTextureToBuffer(source: GpuTexelCopyTextureInfo, destination: GpuTexelCopyBufferInfo, copySize: GpuExtent3D): void;
|
|
1263
|
+
copyTextureToTexture(source: GpuTexelCopyTextureInfo, destination: GpuTexelCopyTextureInfo, copySize: GpuExtent3D): void;
|
|
1264
|
+
clearBuffer(buffer: GpuBuffer, offset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1265
|
+
resolveQuerySet(querySet: GpuQuerySet, firstQuery: GpuSize32, queryCount: GpuSize32, destination: GpuBuffer, destinationOffset: GpuSize64): void;
|
|
1266
|
+
finish(descriptor: GpuCommandBufferDescriptor | undefined): GpuCommandBuffer;
|
|
1267
|
+
label(): string;
|
|
1268
|
+
setLabel(label: string): void;
|
|
1269
|
+
pushDebugGroup(groupLabel: string): void;
|
|
1270
|
+
popDebugGroup(): void;
|
|
1271
|
+
insertDebugMarker(markerLabel: string): void;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
export class GpuCompilationInfo {
|
|
1275
|
+
/**
|
|
1276
|
+
* This type does not have a public constructor.
|
|
1277
|
+
*/
|
|
1278
|
+
private constructor();
|
|
1279
|
+
messages(): Array<GpuCompilationMessage>;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
export class GpuCompilationMessage {
|
|
1283
|
+
/**
|
|
1284
|
+
* This type does not have a public constructor.
|
|
1285
|
+
*/
|
|
1286
|
+
private constructor();
|
|
1287
|
+
message(): string;
|
|
1288
|
+
type(): GpuCompilationMessageType;
|
|
1289
|
+
lineNum(): bigint;
|
|
1290
|
+
linePos(): bigint;
|
|
1291
|
+
offset(): bigint;
|
|
1292
|
+
length(): bigint;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
export class GpuComputePassEncoder {
|
|
1296
|
+
/**
|
|
1297
|
+
* This type does not have a public constructor.
|
|
1298
|
+
*/
|
|
1299
|
+
private constructor();
|
|
1300
|
+
setPipeline(pipeline: GpuComputePipeline): void;
|
|
1301
|
+
dispatchWorkgroups(workgroupCountX: GpuSize32, workgroupCountY: GpuSize32 | undefined, workgroupCountZ: GpuSize32 | undefined): void;
|
|
1302
|
+
dispatchWorkgroupsIndirect(indirectBuffer: GpuBuffer, indirectOffset: GpuSize64): void;
|
|
1303
|
+
end(): void;
|
|
1304
|
+
label(): string;
|
|
1305
|
+
setLabel(label: string): void;
|
|
1306
|
+
pushDebugGroup(groupLabel: string): void;
|
|
1307
|
+
popDebugGroup(): void;
|
|
1308
|
+
insertDebugMarker(markerLabel: string): void;
|
|
1309
|
+
setBindGroup(index: GpuIndex32, bindGroup: GpuBindGroup | undefined, dynamicOffsetsData: Uint32Array | undefined, dynamicOffsetsDataStart: GpuSize64 | undefined, dynamicOffsetsDataLength: GpuSize32 | undefined): void;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
export class GpuComputePipeline {
|
|
1313
|
+
/**
|
|
1314
|
+
* This type does not have a public constructor.
|
|
1315
|
+
*/
|
|
1316
|
+
private constructor();
|
|
1317
|
+
label(): string;
|
|
1318
|
+
setLabel(label: string): void;
|
|
1319
|
+
getBindGroupLayout(index: number): GpuBindGroupLayout;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
export class GpuDevice {
|
|
1323
|
+
/**
|
|
1324
|
+
* This type does not have a public constructor.
|
|
1325
|
+
*/
|
|
1326
|
+
private constructor();
|
|
1327
|
+
features(): GpuSupportedFeatures;
|
|
1328
|
+
limits(): GpuSupportedLimits;
|
|
1329
|
+
adapterInfo(): GpuAdapterInfo;
|
|
1330
|
+
queue(): GpuQueue;
|
|
1331
|
+
destroy(): void;
|
|
1332
|
+
createBuffer(descriptor: GpuBufferDescriptor): GpuBuffer;
|
|
1333
|
+
createTexture(descriptor: GpuTextureDescriptor): GpuTexture;
|
|
1334
|
+
createSampler(descriptor: GpuSamplerDescriptor | undefined): GpuSampler;
|
|
1335
|
+
createBindGroupLayout(descriptor: GpuBindGroupLayoutDescriptor): GpuBindGroupLayout;
|
|
1336
|
+
createPipelineLayout(descriptor: GpuPipelineLayoutDescriptor): GpuPipelineLayout;
|
|
1337
|
+
createBindGroup(descriptor: GpuBindGroupDescriptor): GpuBindGroup;
|
|
1338
|
+
createShaderModule(descriptor: GpuShaderModuleDescriptor): GpuShaderModule;
|
|
1339
|
+
createComputePipeline(descriptor: GpuComputePipelineDescriptor): GpuComputePipeline;
|
|
1340
|
+
createRenderPipeline(descriptor: GpuRenderPipelineDescriptor): GpuRenderPipeline;
|
|
1341
|
+
createComputePipelineAsync(descriptor: GpuComputePipelineDescriptor): GpuComputePipeline;
|
|
1342
|
+
createRenderPipelineAsync(descriptor: GpuRenderPipelineDescriptor): GpuRenderPipeline;
|
|
1343
|
+
createCommandEncoder(descriptor: GpuCommandEncoderDescriptor | undefined): GpuCommandEncoder;
|
|
1344
|
+
createRenderBundleEncoder(descriptor: GpuRenderBundleEncoderDescriptor): GpuRenderBundleEncoder;
|
|
1345
|
+
createQuerySet(descriptor: GpuQuerySetDescriptor): GpuQuerySet;
|
|
1346
|
+
label(): string;
|
|
1347
|
+
setLabel(label: string): void;
|
|
1348
|
+
lost(): GpuDeviceLostInfo;
|
|
1349
|
+
pushErrorScope(filter: GpuErrorFilter): void;
|
|
1350
|
+
popErrorScope(): GpuError | undefined;
|
|
1351
|
+
onuncapturederrorSubscribe(): Pollable;
|
|
1352
|
+
connectGraphicsContext(context: Context): void;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
export class GpuDeviceLostInfo {
|
|
1356
|
+
/**
|
|
1357
|
+
* This type does not have a public constructor.
|
|
1358
|
+
*/
|
|
1359
|
+
private constructor();
|
|
1360
|
+
reason(): GpuDeviceLostReason;
|
|
1361
|
+
message(): string;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
export class GpuError {
|
|
1365
|
+
/**
|
|
1366
|
+
* This type does not have a public constructor.
|
|
1367
|
+
*/
|
|
1368
|
+
private constructor();
|
|
1369
|
+
message(): string;
|
|
1370
|
+
kind(): GpuErrorKind;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
export class GpuMapMode {
|
|
1374
|
+
/**
|
|
1375
|
+
* This type does not have a public constructor.
|
|
1376
|
+
*/
|
|
1377
|
+
private constructor();
|
|
1378
|
+
static read(): GpuFlagsConstant;
|
|
1379
|
+
static write(): GpuFlagsConstant;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
export class GpuPipelineLayout {
|
|
1383
|
+
/**
|
|
1384
|
+
* This type does not have a public constructor.
|
|
1385
|
+
*/
|
|
1386
|
+
private constructor();
|
|
1387
|
+
label(): string;
|
|
1388
|
+
setLabel(label: string): void;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
export class GpuQuerySet {
|
|
1392
|
+
/**
|
|
1393
|
+
* This type does not have a public constructor.
|
|
1394
|
+
*/
|
|
1395
|
+
private constructor();
|
|
1396
|
+
destroy(): void;
|
|
1397
|
+
type(): GpuQueryType;
|
|
1398
|
+
count(): GpuSize32Out;
|
|
1399
|
+
label(): string;
|
|
1400
|
+
setLabel(label: string): void;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export class GpuQueue {
|
|
1404
|
+
/**
|
|
1405
|
+
* This type does not have a public constructor.
|
|
1406
|
+
*/
|
|
1407
|
+
private constructor();
|
|
1408
|
+
submit(commandBuffers: Array<GpuCommandBuffer>): void;
|
|
1409
|
+
onSubmittedWorkDone(): void;
|
|
1410
|
+
writeBufferWithCopy(buffer: GpuBuffer, bufferOffset: GpuSize64, data: Uint8Array, dataOffset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1411
|
+
writeTextureWithCopy(destination: GpuTexelCopyTextureInfo, data: Uint8Array, dataLayout: GpuTexelCopyBufferLayout, size: GpuExtent3D): void;
|
|
1412
|
+
label(): string;
|
|
1413
|
+
setLabel(label: string): void;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
export class GpuRenderBundle {
|
|
1417
|
+
/**
|
|
1418
|
+
* This type does not have a public constructor.
|
|
1419
|
+
*/
|
|
1420
|
+
private constructor();
|
|
1421
|
+
label(): string;
|
|
1422
|
+
setLabel(label: string): void;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
export class GpuRenderBundleEncoder {
|
|
1426
|
+
/**
|
|
1427
|
+
* This type does not have a public constructor.
|
|
1428
|
+
*/
|
|
1429
|
+
private constructor();
|
|
1430
|
+
finish(descriptor: GpuRenderBundleDescriptor | undefined): GpuRenderBundle;
|
|
1431
|
+
label(): string;
|
|
1432
|
+
setLabel(label: string): void;
|
|
1433
|
+
pushDebugGroup(groupLabel: string): void;
|
|
1434
|
+
popDebugGroup(): void;
|
|
1435
|
+
insertDebugMarker(markerLabel: string): void;
|
|
1436
|
+
setBindGroup(index: GpuIndex32, bindGroup: GpuBindGroup | undefined, dynamicOffsetsData: Uint32Array | undefined, dynamicOffsetsDataStart: GpuSize64 | undefined, dynamicOffsetsDataLength: GpuSize32 | undefined): void;
|
|
1437
|
+
setPipeline(pipeline: GpuRenderPipeline): void;
|
|
1438
|
+
setIndexBuffer(buffer: GpuBuffer, indexFormat: GpuIndexFormat, offset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1439
|
+
setVertexBuffer(slot: GpuIndex32, buffer: GpuBuffer | undefined, offset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1440
|
+
draw(vertexCount: GpuSize32, instanceCount: GpuSize32 | undefined, firstVertex: GpuSize32 | undefined, firstInstance: GpuSize32 | undefined): void;
|
|
1441
|
+
drawIndexed(indexCount: GpuSize32, instanceCount: GpuSize32 | undefined, firstIndex: GpuSize32 | undefined, baseVertex: GpuSignedOffset32 | undefined, firstInstance: GpuSize32 | undefined): void;
|
|
1442
|
+
drawIndirect(indirectBuffer: GpuBuffer, indirectOffset: GpuSize64): void;
|
|
1443
|
+
drawIndexedIndirect(indirectBuffer: GpuBuffer, indirectOffset: GpuSize64): void;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export class GpuRenderPassEncoder {
|
|
1447
|
+
/**
|
|
1448
|
+
* This type does not have a public constructor.
|
|
1449
|
+
*/
|
|
1450
|
+
private constructor();
|
|
1451
|
+
setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): void;
|
|
1452
|
+
setScissorRect(x: GpuIntegerCoordinate, y: GpuIntegerCoordinate, width: GpuIntegerCoordinate, height: GpuIntegerCoordinate): void;
|
|
1453
|
+
setBlendConstant(color: GpuColor): void;
|
|
1454
|
+
setStencilReference(reference: GpuStencilValue): void;
|
|
1455
|
+
beginOcclusionQuery(queryIndex: GpuSize32): void;
|
|
1456
|
+
endOcclusionQuery(): void;
|
|
1457
|
+
executeBundles(bundles: Array<GpuRenderBundle>): void;
|
|
1458
|
+
end(): void;
|
|
1459
|
+
label(): string;
|
|
1460
|
+
setLabel(label: string): void;
|
|
1461
|
+
pushDebugGroup(groupLabel: string): void;
|
|
1462
|
+
popDebugGroup(): void;
|
|
1463
|
+
insertDebugMarker(markerLabel: string): void;
|
|
1464
|
+
setBindGroup(index: GpuIndex32, bindGroup: GpuBindGroup | undefined, dynamicOffsetsData: Uint32Array | undefined, dynamicOffsetsDataStart: GpuSize64 | undefined, dynamicOffsetsDataLength: GpuSize32 | undefined): void;
|
|
1465
|
+
setPipeline(pipeline: GpuRenderPipeline): void;
|
|
1466
|
+
setIndexBuffer(buffer: GpuBuffer, indexFormat: GpuIndexFormat, offset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1467
|
+
setVertexBuffer(slot: GpuIndex32, buffer: GpuBuffer | undefined, offset: GpuSize64 | undefined, size: GpuSize64 | undefined): void;
|
|
1468
|
+
draw(vertexCount: GpuSize32, instanceCount: GpuSize32 | undefined, firstVertex: GpuSize32 | undefined, firstInstance: GpuSize32 | undefined): void;
|
|
1469
|
+
drawIndexed(indexCount: GpuSize32, instanceCount: GpuSize32 | undefined, firstIndex: GpuSize32 | undefined, baseVertex: GpuSignedOffset32 | undefined, firstInstance: GpuSize32 | undefined): void;
|
|
1470
|
+
drawIndirect(indirectBuffer: GpuBuffer, indirectOffset: GpuSize64): void;
|
|
1471
|
+
drawIndexedIndirect(indirectBuffer: GpuBuffer, indirectOffset: GpuSize64): void;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
export class GpuRenderPipeline {
|
|
1475
|
+
/**
|
|
1476
|
+
* This type does not have a public constructor.
|
|
1477
|
+
*/
|
|
1478
|
+
private constructor();
|
|
1479
|
+
label(): string;
|
|
1480
|
+
setLabel(label: string): void;
|
|
1481
|
+
getBindGroupLayout(index: number): GpuBindGroupLayout;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
export class GpuSampler {
|
|
1485
|
+
/**
|
|
1486
|
+
* This type does not have a public constructor.
|
|
1487
|
+
*/
|
|
1488
|
+
private constructor();
|
|
1489
|
+
label(): string;
|
|
1490
|
+
setLabel(label: string): void;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
export class GpuShaderModule {
|
|
1494
|
+
/**
|
|
1495
|
+
* This type does not have a public constructor.
|
|
1496
|
+
*/
|
|
1497
|
+
private constructor();
|
|
1498
|
+
getCompilationInfo(): GpuCompilationInfo;
|
|
1499
|
+
label(): string;
|
|
1500
|
+
setLabel(label: string): void;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
export class GpuShaderStage {
|
|
1504
|
+
/**
|
|
1505
|
+
* This type does not have a public constructor.
|
|
1506
|
+
*/
|
|
1507
|
+
private constructor();
|
|
1508
|
+
static vertex(): GpuFlagsConstant;
|
|
1509
|
+
static fragment(): GpuFlagsConstant;
|
|
1510
|
+
static compute(): GpuFlagsConstant;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
export class GpuSupportedFeatures {
|
|
1514
|
+
/**
|
|
1515
|
+
* This type does not have a public constructor.
|
|
1516
|
+
*/
|
|
1517
|
+
private constructor();
|
|
1518
|
+
has(value: string): boolean;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
export class GpuSupportedLimits {
|
|
1522
|
+
/**
|
|
1523
|
+
* This type does not have a public constructor.
|
|
1524
|
+
*/
|
|
1525
|
+
private constructor();
|
|
1526
|
+
maxTextureDimension1D(): number;
|
|
1527
|
+
maxTextureDimension2D(): number;
|
|
1528
|
+
maxTextureDimension3D(): number;
|
|
1529
|
+
maxTextureArrayLayers(): number;
|
|
1530
|
+
maxBindGroups(): number;
|
|
1531
|
+
maxBindGroupsPlusVertexBuffers(): number;
|
|
1532
|
+
maxBindingsPerBindGroup(): number;
|
|
1533
|
+
maxDynamicUniformBuffersPerPipelineLayout(): number;
|
|
1534
|
+
maxDynamicStorageBuffersPerPipelineLayout(): number;
|
|
1535
|
+
maxSampledTexturesPerShaderStage(): number;
|
|
1536
|
+
maxSamplersPerShaderStage(): number;
|
|
1537
|
+
maxStorageBuffersPerShaderStage(): number;
|
|
1538
|
+
maxStorageTexturesPerShaderStage(): number;
|
|
1539
|
+
maxUniformBuffersPerShaderStage(): number;
|
|
1540
|
+
maxUniformBufferBindingSize(): bigint;
|
|
1541
|
+
maxStorageBufferBindingSize(): bigint;
|
|
1542
|
+
minUniformBufferOffsetAlignment(): number;
|
|
1543
|
+
minStorageBufferOffsetAlignment(): number;
|
|
1544
|
+
maxVertexBuffers(): number;
|
|
1545
|
+
maxBufferSize(): bigint;
|
|
1546
|
+
maxVertexAttributes(): number;
|
|
1547
|
+
maxVertexBufferArrayStride(): number;
|
|
1548
|
+
maxInterStageShaderVariables(): number;
|
|
1549
|
+
maxColorAttachments(): number;
|
|
1550
|
+
maxColorAttachmentBytesPerSample(): number;
|
|
1551
|
+
maxComputeWorkgroupStorageSize(): number;
|
|
1552
|
+
maxComputeInvocationsPerWorkgroup(): number;
|
|
1553
|
+
maxComputeWorkgroupSizeX(): number;
|
|
1554
|
+
maxComputeWorkgroupSizeY(): number;
|
|
1555
|
+
maxComputeWorkgroupSizeZ(): number;
|
|
1556
|
+
maxComputeWorkgroupsPerDimension(): number;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
export class GpuTexture {
|
|
1560
|
+
/**
|
|
1561
|
+
* This type does not have a public constructor.
|
|
1562
|
+
*/
|
|
1563
|
+
private constructor();
|
|
1564
|
+
createView(descriptor: GpuTextureViewDescriptor | undefined): GpuTextureView;
|
|
1565
|
+
destroy(): void;
|
|
1566
|
+
width(): GpuIntegerCoordinateOut;
|
|
1567
|
+
height(): GpuIntegerCoordinateOut;
|
|
1568
|
+
depthOrArrayLayers(): GpuIntegerCoordinateOut;
|
|
1569
|
+
mipLevelCount(): GpuIntegerCoordinateOut;
|
|
1570
|
+
sampleCount(): GpuSize32Out;
|
|
1571
|
+
dimension(): GpuTextureDimension;
|
|
1572
|
+
format(): GpuTextureFormat;
|
|
1573
|
+
usage(): GpuFlagsConstant;
|
|
1574
|
+
label(): string;
|
|
1575
|
+
setLabel(label: string): void;
|
|
1576
|
+
static fromGraphicsBuffer(buffer: AbstractBuffer): GpuTexture;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
export class GpuTextureUsage {
|
|
1580
|
+
/**
|
|
1581
|
+
* This type does not have a public constructor.
|
|
1582
|
+
*/
|
|
1583
|
+
private constructor();
|
|
1584
|
+
static copySrc(): GpuFlagsConstant;
|
|
1585
|
+
static copyDst(): GpuFlagsConstant;
|
|
1586
|
+
static textureBinding(): GpuFlagsConstant;
|
|
1587
|
+
static storageBinding(): GpuFlagsConstant;
|
|
1588
|
+
static renderAttachment(): GpuFlagsConstant;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
export class GpuTextureView {
|
|
1592
|
+
/**
|
|
1593
|
+
* This type does not have a public constructor.
|
|
1594
|
+
*/
|
|
1595
|
+
private constructor();
|
|
1596
|
+
label(): string;
|
|
1597
|
+
setLabel(label: string): void;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
export class GpuUncapturedErrorEvent {
|
|
1601
|
+
/**
|
|
1602
|
+
* This type does not have a public constructor.
|
|
1603
|
+
*/
|
|
1604
|
+
private constructor();
|
|
1605
|
+
error(): GpuError;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
export class RecordGpuPipelineConstantValue {
|
|
1609
|
+
constructor()
|
|
1610
|
+
add(key: string, value: GpuPipelineConstantValue): void;
|
|
1611
|
+
get(key: string): GpuPipelineConstantValue | undefined;
|
|
1612
|
+
has(key: string): boolean;
|
|
1613
|
+
remove(key: string): void;
|
|
1614
|
+
keys(): Array<string>;
|
|
1615
|
+
values(): Float64Array;
|
|
1616
|
+
entries(): Array<[string, GpuPipelineConstantValue]>;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
export class RecordOptionGpuSize64 {
|
|
1620
|
+
constructor()
|
|
1621
|
+
add(key: string, value: GpuSize64 | undefined): void;
|
|
1622
|
+
get(key: string): Option<GpuSize64 | undefined>;
|
|
1623
|
+
has(key: string): boolean;
|
|
1624
|
+
remove(key: string): void;
|
|
1625
|
+
keys(): Array<string>;
|
|
1626
|
+
values(): Array<GpuSize64 | undefined>;
|
|
1627
|
+
entries(): Array<[string, GpuSize64 | undefined]>;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
export class WgslLanguageFeatures {
|
|
1631
|
+
/**
|
|
1632
|
+
* This type does not have a public constructor.
|
|
1633
|
+
*/
|
|
1634
|
+
private constructor();
|
|
1635
|
+
has(value: string): boolean;
|
|
1636
|
+
}
|