Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/src/closure-externs/webgpu-externs.js
4133 views
1
/*
2
* WebGPU globals
3
* Generated using https://github.com/kainino0x/webidl-to-closure-externs
4
* against the spec's WebIDL: https://gpuweb.github.io/gpuweb/webgpu.idl
5
*/
6
7
/** @type {?GPU} */
8
Navigator.prototype.gpu;
9
10
/** @type {?GPU} */
11
WorkerNavigator.prototype.gpu;
12
13
const GPUBufferUsage = {};
14
/** @type {number} */
15
GPUBufferUsage.MAP_READ;
16
/** @type {number} */
17
GPUBufferUsage.MAP_WRITE;
18
/** @type {number} */
19
GPUBufferUsage.COPY_SRC;
20
/** @type {number} */
21
GPUBufferUsage.COPY_DST;
22
/** @type {number} */
23
GPUBufferUsage.INDEX;
24
/** @type {number} */
25
GPUBufferUsage.VERTEX;
26
/** @type {number} */
27
GPUBufferUsage.UNIFORM;
28
/** @type {number} */
29
GPUBufferUsage.STORAGE;
30
/** @type {number} */
31
GPUBufferUsage.INDIRECT;
32
/** @type {number} */
33
GPUBufferUsage.QUERY_RESOLVE;
34
35
const GPUMapMode = {};
36
/** @type {number} */
37
GPUMapMode.READ;
38
/** @type {number} */
39
GPUMapMode.WRITE;
40
41
const GPUTextureUsage = {};
42
/** @type {number} */
43
GPUTextureUsage.COPY_SRC;
44
/** @type {number} */
45
GPUTextureUsage.COPY_DST;
46
/** @type {number} */
47
GPUTextureUsage.TEXTURE_BINDING;
48
/** @type {number} */
49
GPUTextureUsage.STORAGE_BINDING;
50
/** @type {number} */
51
GPUTextureUsage.RENDER_ATTACHMENT;
52
53
const GPUShaderStage = {};
54
/** @type {number} */
55
GPUShaderStage.VERTEX;
56
/** @type {number} */
57
GPUShaderStage.FRAGMENT;
58
/** @type {number} */
59
GPUShaderStage.COMPUTE;
60
61
const GPUColorWrite = {};
62
/** @type {number} */
63
GPUColorWrite.RED;
64
/** @type {number} */
65
GPUColorWrite.GREEN;
66
/** @type {number} */
67
GPUColorWrite.BLUE;
68
/** @type {number} */
69
GPUColorWrite.ALPHA;
70
/** @type {number} */
71
GPUColorWrite.ALL;
72
73
/** @constructor */
74
function GPUSupportedLimits() {}
75
/** @type {number} */
76
GPUSupportedLimits.prototype.maxTextureDimension1D;
77
/** @type {number} */
78
GPUSupportedLimits.prototype.maxTextureDimension2D;
79
/** @type {number} */
80
GPUSupportedLimits.prototype.maxTextureDimension3D;
81
/** @type {number} */
82
GPUSupportedLimits.prototype.maxTextureArrayLayers;
83
/** @type {number} */
84
GPUSupportedLimits.prototype.maxBindGroups;
85
/** @type {number} */
86
GPUSupportedLimits.prototype.maxBindGroupsPlusVertexBuffers;
87
/** @type {number} */
88
GPUSupportedLimits.prototype.maxBindingsPerBindGroup;
89
/** @type {number} */
90
GPUSupportedLimits.prototype.maxDynamicUniformBuffersPerPipelineLayout;
91
/** @type {number} */
92
GPUSupportedLimits.prototype.maxDynamicStorageBuffersPerPipelineLayout;
93
/** @type {number} */
94
GPUSupportedLimits.prototype.maxSampledTexturesPerShaderStage;
95
/** @type {number} */
96
GPUSupportedLimits.prototype.maxSamplersPerShaderStage;
97
/** @type {number} */
98
GPUSupportedLimits.prototype.maxStorageBuffersPerShaderStage;
99
/** @type {number} */
100
GPUSupportedLimits.prototype.maxStorageTexturesPerShaderStage;
101
/** @type {number} */
102
GPUSupportedLimits.prototype.maxUniformBuffersPerShaderStage;
103
/** @type {number} */
104
GPUSupportedLimits.prototype.maxUniformBufferBindingSize;
105
/** @type {number} */
106
GPUSupportedLimits.prototype.maxStorageBufferBindingSize;
107
/** @type {number} */
108
GPUSupportedLimits.prototype.minUniformBufferOffsetAlignment;
109
/** @type {number} */
110
GPUSupportedLimits.prototype.minStorageBufferOffsetAlignment;
111
/** @type {number} */
112
GPUSupportedLimits.prototype.maxVertexBuffers;
113
/** @type {number} */
114
GPUSupportedLimits.prototype.maxBufferSize;
115
/** @type {number} */
116
GPUSupportedLimits.prototype.maxVertexAttributes;
117
/** @type {number} */
118
GPUSupportedLimits.prototype.maxVertexBufferArrayStride;
119
/** @type {number} */
120
GPUSupportedLimits.prototype.maxInterStageShaderComponents;
121
/** @type {number} */
122
GPUSupportedLimits.prototype.maxInterStageShaderVariables;
123
/** @type {number} */
124
GPUSupportedLimits.prototype.maxColorAttachments;
125
/** @type {number} */
126
GPUSupportedLimits.prototype.maxColorAttachmentBytesPerSample;
127
/** @type {number} */
128
GPUSupportedLimits.prototype.maxComputeWorkgroupStorageSize;
129
/** @type {number} */
130
GPUSupportedLimits.prototype.maxComputeInvocationsPerWorkgroup;
131
/** @type {number} */
132
GPUSupportedLimits.prototype.maxComputeWorkgroupSizeX;
133
/** @type {number} */
134
GPUSupportedLimits.prototype.maxComputeWorkgroupSizeY;
135
/** @type {number} */
136
GPUSupportedLimits.prototype.maxComputeWorkgroupSizeZ;
137
/** @type {number} */
138
GPUSupportedLimits.prototype.maxComputeWorkgroupsPerDimension;
139
140
/** @constructor */
141
function GPUSupportedFeatures() {}
142
/** @type {number} */
143
GPUSupportedFeatures.prototype.size;
144
/** @return {!Iterable<string>} */
145
GPUSupportedFeatures.prototype.entries = function() {};
146
/** @return {!Iterable<string>} */
147
GPUSupportedFeatures.prototype.keys = function() {};
148
/** @return {!Iterable<string>} */
149
GPUSupportedFeatures.prototype.values = function() {};
150
/** @return {undefined} */
151
GPUSupportedFeatures.prototype.forEach = function() {};
152
/** @return {boolean} */
153
GPUSupportedFeatures.prototype.has = function() {};
154
155
/** @constructor */
156
function WGSLLanguageFeatures() {}
157
/** @type {number} */
158
WGSLLanguageFeatures.prototype.size;
159
/** @return {!Iterable<string>} */
160
WGSLLanguageFeatures.prototype.entries = function() {};
161
/** @return {!Iterable<string>} */
162
WGSLLanguageFeatures.prototype.keys = function() {};
163
/** @return {!Iterable<string>} */
164
WGSLLanguageFeatures.prototype.values = function() {};
165
/** @return {undefined} */
166
WGSLLanguageFeatures.prototype.forEach = function() {};
167
/** @return {boolean} */
168
WGSLLanguageFeatures.prototype.has = function() {};
169
170
/** @constructor */
171
function GPUAdapterInfo() {}
172
/** @type {string} */
173
GPUAdapterInfo.prototype.vendor;
174
/** @type {string} */
175
GPUAdapterInfo.prototype.architecture;
176
/** @type {string} */
177
GPUAdapterInfo.prototype.device;
178
/** @type {string} */
179
GPUAdapterInfo.prototype.description;
180
181
/** @constructor */
182
function GPU() {}
183
/** @return {!Promise<?GPUAdapter>} */
184
GPU.prototype.requestAdapter = function() {};
185
/** @return {string} */
186
GPU.prototype.getPreferredCanvasFormat = function() {};
187
/** @type {!WGSLLanguageFeatures} */
188
GPU.prototype.wgslLanguageFeatures;
189
190
/** @constructor */
191
function GPUAdapter() {}
192
/** @type {!GPUSupportedFeatures} */
193
GPUAdapter.prototype.features;
194
/** @type {!GPUSupportedLimits} */
195
GPUAdapter.prototype.limits;
196
/** @type {boolean} */
197
GPUAdapter.prototype.isFallbackAdapter;
198
/** @return {!Promise<!GPUDevice>} */
199
GPUAdapter.prototype.requestDevice = function() {};
200
/** @return {!Promise<!GPUAdapterInfo>} */
201
GPUAdapter.prototype.requestAdapterInfo = function() {};
202
/** @type {!GPUAdapterInfo} */
203
GPUAdapter.prototype.info;
204
205
/** @constructor */
206
function GPUDevice() {}
207
/** @type {string} */
208
GPUDevice.prototype.label;
209
/** @type {!GPUSupportedFeatures} */
210
GPUDevice.prototype.features;
211
/** @type {!GPUSupportedLimits} */
212
GPUDevice.prototype.limits;
213
/** @type {!GPUQueue} */
214
GPUDevice.prototype.queue;
215
/** @return {undefined} */
216
GPUDevice.prototype.destroy = function() {};
217
/** @return {!GPUBuffer} */
218
GPUDevice.prototype.createBuffer = function() {};
219
/** @return {!GPUTexture} */
220
GPUDevice.prototype.createTexture = function() {};
221
/** @return {!GPUSampler} */
222
GPUDevice.prototype.createSampler = function() {};
223
/** @return {!GPUExternalTexture} */
224
GPUDevice.prototype.importExternalTexture = function() {};
225
/** @return {!GPUBindGroupLayout} */
226
GPUDevice.prototype.createBindGroupLayout = function() {};
227
/** @return {!GPUPipelineLayout} */
228
GPUDevice.prototype.createPipelineLayout = function() {};
229
/** @return {!GPUBindGroup} */
230
GPUDevice.prototype.createBindGroup = function() {};
231
/** @return {!GPUShaderModule} */
232
GPUDevice.prototype.createShaderModule = function() {};
233
/** @return {!GPUComputePipeline} */
234
GPUDevice.prototype.createComputePipeline = function() {};
235
/** @return {!GPURenderPipeline} */
236
GPUDevice.prototype.createRenderPipeline = function() {};
237
/** @return {!Promise<!GPUComputePipeline>} */
238
GPUDevice.prototype.createComputePipelineAsync = function() {};
239
/** @return {!Promise<!GPURenderPipeline>} */
240
GPUDevice.prototype.createRenderPipelineAsync = function() {};
241
/** @return {!GPUCommandEncoder} */
242
GPUDevice.prototype.createCommandEncoder = function() {};
243
/** @return {!GPURenderBundleEncoder} */
244
GPUDevice.prototype.createRenderBundleEncoder = function() {};
245
/** @return {!GPUQuerySet} */
246
GPUDevice.prototype.createQuerySet = function() {};
247
/** @type {!Promise<!GPUDeviceLostInfo>} */
248
GPUDevice.prototype.lost;
249
/** @return {undefined} */
250
GPUDevice.prototype.pushErrorScope = function() {};
251
/** @return {!Promise<?GPUError>} */
252
GPUDevice.prototype.popErrorScope = function() {};
253
/** @type {!Function} */
254
GPUDevice.prototype.onuncapturederror;
255
/** @type {!GPUAdapterInfo} */
256
GPUDevice.prototype.adapterInfo;
257
258
/** @constructor */
259
function GPUBuffer() {}
260
/** @type {string} */
261
GPUBuffer.prototype.label;
262
/** @type {number} */
263
GPUBuffer.prototype.size;
264
/** @type {number} */
265
GPUBuffer.prototype.usage;
266
/** @type {string} */
267
GPUBuffer.prototype.mapState;
268
/** @return {!Promise<undefined>} */
269
GPUBuffer.prototype.mapAsync = function() {};
270
/** @return {!ArrayBuffer} */
271
GPUBuffer.prototype.getMappedRange = function() {};
272
/** @return {undefined} */
273
GPUBuffer.prototype.unmap = function() {};
274
/** @return {undefined} */
275
GPUBuffer.prototype.destroy = function() {};
276
277
/** @constructor */
278
function GPUTexture() {}
279
/** @type {string} */
280
GPUTexture.prototype.label;
281
/** @return {!GPUTextureView} */
282
GPUTexture.prototype.createView = function() {};
283
/** @return {undefined} */
284
GPUTexture.prototype.destroy = function() {};
285
/** @type {number} */
286
GPUTexture.prototype.width;
287
/** @type {number} */
288
GPUTexture.prototype.height;
289
/** @type {number} */
290
GPUTexture.prototype.depthOrArrayLayers;
291
/** @type {number} */
292
GPUTexture.prototype.mipLevelCount;
293
/** @type {number} */
294
GPUTexture.prototype.sampleCount;
295
/** @type {string} */
296
GPUTexture.prototype.dimension;
297
/** @type {string} */
298
GPUTexture.prototype.format;
299
/** @type {number} */
300
GPUTexture.prototype.usage;
301
302
/** @constructor */
303
function GPUTextureView() {}
304
/** @type {string} */
305
GPUTextureView.prototype.label;
306
307
/** @constructor */
308
function GPUExternalTexture() {}
309
/** @type {string} */
310
GPUExternalTexture.prototype.label;
311
312
/** @constructor */
313
function GPUSampler() {}
314
/** @type {string} */
315
GPUSampler.prototype.label;
316
317
/** @constructor */
318
function GPUBindGroupLayout() {}
319
/** @type {string} */
320
GPUBindGroupLayout.prototype.label;
321
322
/** @constructor */
323
function GPUBindGroup() {}
324
/** @type {string} */
325
GPUBindGroup.prototype.label;
326
327
/** @constructor */
328
function GPUPipelineLayout() {}
329
/** @type {string} */
330
GPUPipelineLayout.prototype.label;
331
332
/** @constructor */
333
function GPUShaderModule() {}
334
/** @type {string} */
335
GPUShaderModule.prototype.label;
336
/** @return {!Promise<!GPUCompilationInfo>} */
337
GPUShaderModule.prototype.getCompilationInfo = function() {};
338
339
/** @constructor */
340
function GPUCompilationMessage() {}
341
/** @type {string} */
342
GPUCompilationMessage.prototype.message;
343
/** @type {string} */
344
GPUCompilationMessage.prototype.type;
345
/** @type {number} */
346
GPUCompilationMessage.prototype.lineNum;
347
/** @type {number} */
348
GPUCompilationMessage.prototype.linePos;
349
/** @type {number} */
350
GPUCompilationMessage.prototype.offset;
351
/** @type {number} */
352
GPUCompilationMessage.prototype.length;
353
354
/** @constructor */
355
function GPUCompilationInfo() {}
356
/** @type {!Array<!GPUCompilationMessage>} */
357
GPUCompilationInfo.prototype.messages;
358
359
/** @constructor */
360
function GPUPipelineError() {}
361
/** @type {string} */
362
GPUPipelineError.prototype.reason;
363
364
/** @constructor */
365
function GPUComputePipeline() {}
366
/** @type {string} */
367
GPUComputePipeline.prototype.label;
368
/** @return {!GPUBindGroupLayout} */
369
GPUComputePipeline.prototype.getBindGroupLayout = function() {};
370
371
/** @constructor */
372
function GPURenderPipeline() {}
373
/** @type {string} */
374
GPURenderPipeline.prototype.label;
375
/** @return {!GPUBindGroupLayout} */
376
GPURenderPipeline.prototype.getBindGroupLayout = function() {};
377
378
/** @constructor */
379
function GPUCommandBuffer() {}
380
/** @type {string} */
381
GPUCommandBuffer.prototype.label;
382
383
/** @constructor */
384
function GPUCommandEncoder() {}
385
/** @type {string} */
386
GPUCommandEncoder.prototype.label;
387
/** @return {undefined} */
388
GPUCommandEncoder.prototype.pushDebugGroup = function() {};
389
/** @return {undefined} */
390
GPUCommandEncoder.prototype.popDebugGroup = function() {};
391
/** @return {undefined} */
392
GPUCommandEncoder.prototype.insertDebugMarker = function() {};
393
/** @return {!GPURenderPassEncoder} */
394
GPUCommandEncoder.prototype.beginRenderPass = function() {};
395
/** @return {!GPUComputePassEncoder} */
396
GPUCommandEncoder.prototype.beginComputePass = function() {};
397
/** @return {undefined} */
398
GPUCommandEncoder.prototype.copyBufferToBuffer = function() {};
399
/** @return {undefined} */
400
GPUCommandEncoder.prototype.copyBufferToTexture = function() {};
401
/** @return {undefined} */
402
GPUCommandEncoder.prototype.copyTextureToBuffer = function() {};
403
/** @return {undefined} */
404
GPUCommandEncoder.prototype.copyTextureToTexture = function() {};
405
/** @return {undefined} */
406
GPUCommandEncoder.prototype.clearBuffer = function() {};
407
/** @return {undefined} */
408
GPUCommandEncoder.prototype.resolveQuerySet = function() {};
409
/** @return {!GPUCommandBuffer} */
410
GPUCommandEncoder.prototype.finish = function() {};
411
412
/** @constructor */
413
function GPUComputePassEncoder() {}
414
/** @type {string} */
415
GPUComputePassEncoder.prototype.label;
416
/** @return {undefined} */
417
GPUComputePassEncoder.prototype.pushDebugGroup = function() {};
418
/** @return {undefined} */
419
GPUComputePassEncoder.prototype.popDebugGroup = function() {};
420
/** @return {undefined} */
421
GPUComputePassEncoder.prototype.insertDebugMarker = function() {};
422
/** @return {undefined} */
423
GPUComputePassEncoder.prototype.setBindGroup = function() {};
424
/** @return {undefined} */
425
GPUComputePassEncoder.prototype.setBindGroup = function() {};
426
/** @return {undefined} */
427
GPUComputePassEncoder.prototype.setPipeline = function() {};
428
/** @return {undefined} */
429
GPUComputePassEncoder.prototype.dispatchWorkgroups = function() {};
430
/** @return {undefined} */
431
GPUComputePassEncoder.prototype.dispatchWorkgroupsIndirect = function() {};
432
/** @return {undefined} */
433
GPUComputePassEncoder.prototype.end = function() {};
434
435
/** @constructor */
436
function GPURenderPassEncoder() {}
437
/** @type {string} */
438
GPURenderPassEncoder.prototype.label;
439
/** @return {undefined} */
440
GPURenderPassEncoder.prototype.pushDebugGroup = function() {};
441
/** @return {undefined} */
442
GPURenderPassEncoder.prototype.popDebugGroup = function() {};
443
/** @return {undefined} */
444
GPURenderPassEncoder.prototype.insertDebugMarker = function() {};
445
/** @return {undefined} */
446
GPURenderPassEncoder.prototype.setBindGroup = function() {};
447
/** @return {undefined} */
448
GPURenderPassEncoder.prototype.setBindGroup = function() {};
449
/** @return {undefined} */
450
GPURenderPassEncoder.prototype.setPipeline = function() {};
451
/** @return {undefined} */
452
GPURenderPassEncoder.prototype.setIndexBuffer = function() {};
453
/** @return {undefined} */
454
GPURenderPassEncoder.prototype.setVertexBuffer = function() {};
455
/** @return {undefined} */
456
GPURenderPassEncoder.prototype.draw = function() {};
457
/** @return {undefined} */
458
GPURenderPassEncoder.prototype.drawIndexed = function() {};
459
/** @return {undefined} */
460
GPURenderPassEncoder.prototype.drawIndirect = function() {};
461
/** @return {undefined} */
462
GPURenderPassEncoder.prototype.drawIndexedIndirect = function() {};
463
/** @return {undefined} */
464
GPURenderPassEncoder.prototype.setViewport = function() {};
465
/** @return {undefined} */
466
GPURenderPassEncoder.prototype.setScissorRect = function() {};
467
/** @return {undefined} */
468
GPURenderPassEncoder.prototype.setBlendConstant = function() {};
469
/** @return {undefined} */
470
GPURenderPassEncoder.prototype.setStencilReference = function() {};
471
/** @return {undefined} */
472
GPURenderPassEncoder.prototype.beginOcclusionQuery = function() {};
473
/** @return {undefined} */
474
GPURenderPassEncoder.prototype.endOcclusionQuery = function() {};
475
/** @return {undefined} */
476
GPURenderPassEncoder.prototype.executeBundles = function() {};
477
/** @return {undefined} */
478
GPURenderPassEncoder.prototype.end = function() {};
479
480
/** @constructor */
481
function GPURenderBundle() {}
482
/** @type {string} */
483
GPURenderBundle.prototype.label;
484
485
/** @constructor */
486
function GPURenderBundleEncoder() {}
487
/** @type {string} */
488
GPURenderBundleEncoder.prototype.label;
489
/** @return {undefined} */
490
GPURenderBundleEncoder.prototype.pushDebugGroup = function() {};
491
/** @return {undefined} */
492
GPURenderBundleEncoder.prototype.popDebugGroup = function() {};
493
/** @return {undefined} */
494
GPURenderBundleEncoder.prototype.insertDebugMarker = function() {};
495
/** @return {undefined} */
496
GPURenderBundleEncoder.prototype.setBindGroup = function() {};
497
/** @return {undefined} */
498
GPURenderBundleEncoder.prototype.setBindGroup = function() {};
499
/** @return {undefined} */
500
GPURenderBundleEncoder.prototype.setPipeline = function() {};
501
/** @return {undefined} */
502
GPURenderBundleEncoder.prototype.setIndexBuffer = function() {};
503
/** @return {undefined} */
504
GPURenderBundleEncoder.prototype.setVertexBuffer = function() {};
505
/** @return {undefined} */
506
GPURenderBundleEncoder.prototype.draw = function() {};
507
/** @return {undefined} */
508
GPURenderBundleEncoder.prototype.drawIndexed = function() {};
509
/** @return {undefined} */
510
GPURenderBundleEncoder.prototype.drawIndirect = function() {};
511
/** @return {undefined} */
512
GPURenderBundleEncoder.prototype.drawIndexedIndirect = function() {};
513
/** @return {!GPURenderBundle} */
514
GPURenderBundleEncoder.prototype.finish = function() {};
515
516
/** @constructor */
517
function GPUQueue() {}
518
/** @type {string} */
519
GPUQueue.prototype.label;
520
/** @return {undefined} */
521
GPUQueue.prototype.submit = function() {};
522
/** @return {!Promise<undefined>} */
523
GPUQueue.prototype.onSubmittedWorkDone = function() {};
524
/** @return {undefined} */
525
GPUQueue.prototype.writeBuffer = function() {};
526
/** @return {undefined} */
527
GPUQueue.prototype.writeTexture = function() {};
528
/** @return {undefined} */
529
GPUQueue.prototype.copyExternalImageToTexture = function() {};
530
531
/** @constructor */
532
function GPUQuerySet() {}
533
/** @type {string} */
534
GPUQuerySet.prototype.label;
535
/** @return {undefined} */
536
GPUQuerySet.prototype.destroy = function() {};
537
/** @type {string} */
538
GPUQuerySet.prototype.type;
539
/** @type {number} */
540
GPUQuerySet.prototype.count;
541
542
/** @constructor */
543
function GPUCanvasContext() {}
544
/** @type {!HTMLCanvasElement|!OffscreenCanvas} */
545
GPUCanvasContext.prototype.canvas;
546
/** @return {undefined} */
547
GPUCanvasContext.prototype.configure = function() {};
548
/** @return {undefined} */
549
GPUCanvasContext.prototype.unconfigure = function() {};
550
/** @return {!GPUTexture} */
551
GPUCanvasContext.prototype.getCurrentTexture = function() {};
552
553
/** @constructor */
554
function GPUDeviceLostInfo() {}
555
/** @type {string} */
556
GPUDeviceLostInfo.prototype.reason;
557
/** @type {string} */
558
GPUDeviceLostInfo.prototype.message;
559
560
/** @constructor */
561
function GPUError() {}
562
/** @type {string} */
563
GPUError.prototype.message;
564
565
/** @constructor */
566
function GPUValidationError() {}
567
568
/** @constructor */
569
function GPUOutOfMemoryError() {}
570
571
/** @constructor */
572
function GPUInternalError() {}
573
574
/** @constructor */
575
function GPUUncapturedErrorEvent() {}
576
/** @type {!GPUError} */
577
GPUUncapturedErrorEvent.prototype.error;
578
579