@types/sharedworker 0.0.219 → 0.0.220
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 +1 -1
- package/index.d.ts +146 -1
- package/package.json +1 -1
- package/ts5.5/index.d.ts +146 -1
- package/ts5.6/index.d.ts +146 -1
- package/ts5.9/index.d.ts +146 -1
package/README.md
CHANGED
|
@@ -28,4 +28,4 @@ This project does not respect semantic versioning as almost every change could p
|
|
|
28
28
|
|
|
29
29
|
## Deploy Metadata
|
|
30
30
|
|
|
31
|
-
You can read what changed in version 0.0.
|
|
31
|
+
You can read what changed in version 0.0.220 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fsharedworker%400.0.220.
|
package/index.d.ts
CHANGED
|
@@ -229,6 +229,20 @@ interface GPUBindGroupEntry {
|
|
|
229
229
|
resource: GPUBindingResource;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
233
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
interface GPUBindGroupLayoutEntry {
|
|
237
|
+
binding: GPUIndex32;
|
|
238
|
+
buffer?: GPUBufferBindingLayout;
|
|
239
|
+
externalTexture?: GPUExternalTextureBindingLayout;
|
|
240
|
+
sampler?: GPUSamplerBindingLayout;
|
|
241
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
242
|
+
texture?: GPUTextureBindingLayout;
|
|
243
|
+
visibility: GPUShaderStageFlags;
|
|
244
|
+
}
|
|
245
|
+
|
|
232
246
|
interface GPUBlendComponent {
|
|
233
247
|
dstFactor?: GPUBlendFactor;
|
|
234
248
|
operation?: GPUBlendOperation;
|
|
@@ -246,6 +260,12 @@ interface GPUBufferBinding {
|
|
|
246
260
|
size?: GPUSize64;
|
|
247
261
|
}
|
|
248
262
|
|
|
263
|
+
interface GPUBufferBindingLayout {
|
|
264
|
+
hasDynamicOffset?: boolean;
|
|
265
|
+
minBindingSize?: GPUSize64;
|
|
266
|
+
type?: GPUBufferBindingType;
|
|
267
|
+
}
|
|
268
|
+
|
|
249
269
|
interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
|
|
250
270
|
mappedAtCreation?: boolean;
|
|
251
271
|
size: GPUSize64;
|
|
@@ -323,12 +343,21 @@ interface GPUDepthStencilState {
|
|
|
323
343
|
stencilWriteMask?: GPUStencilValue;
|
|
324
344
|
}
|
|
325
345
|
|
|
346
|
+
interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
|
|
347
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
348
|
+
requiredFeatures?: GPUFeatureName[];
|
|
349
|
+
requiredLimits?: Record<string, GPUSize64 | undefined>;
|
|
350
|
+
}
|
|
351
|
+
|
|
326
352
|
interface GPUExtent3DDict {
|
|
327
353
|
depthOrArrayLayers?: GPUIntegerCoordinate;
|
|
328
354
|
height?: GPUIntegerCoordinate;
|
|
329
355
|
width: GPUIntegerCoordinate;
|
|
330
356
|
}
|
|
331
357
|
|
|
358
|
+
interface GPUExternalTextureBindingLayout {
|
|
359
|
+
}
|
|
360
|
+
|
|
332
361
|
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
|
|
333
362
|
colorSpace?: PredefinedColorSpace;
|
|
334
363
|
}
|
|
@@ -389,6 +418,9 @@ interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
|
|
|
389
418
|
type: GPUQueryType;
|
|
390
419
|
}
|
|
391
420
|
|
|
421
|
+
interface GPUQueueDescriptor extends GPUObjectDescriptorBase {
|
|
422
|
+
}
|
|
423
|
+
|
|
392
424
|
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
|
|
393
425
|
}
|
|
394
426
|
|
|
@@ -446,6 +478,15 @@ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
|
|
|
446
478
|
vertex: GPUVertexState;
|
|
447
479
|
}
|
|
448
480
|
|
|
481
|
+
interface GPURequestAdapterOptions {
|
|
482
|
+
forceFallbackAdapter?: boolean;
|
|
483
|
+
powerPreference?: GPUPowerPreference;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
interface GPUSamplerBindingLayout {
|
|
487
|
+
type?: GPUSamplerBindingType;
|
|
488
|
+
}
|
|
489
|
+
|
|
449
490
|
interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
|
|
450
491
|
addressModeU?: GPUAddressMode;
|
|
451
492
|
addressModeV?: GPUAddressMode;
|
|
@@ -470,6 +511,12 @@ interface GPUStencilFaceState {
|
|
|
470
511
|
passOp?: GPUStencilOperation;
|
|
471
512
|
}
|
|
472
513
|
|
|
514
|
+
interface GPUStorageTextureBindingLayout {
|
|
515
|
+
access?: GPUStorageTextureAccess;
|
|
516
|
+
format: GPUTextureFormat;
|
|
517
|
+
viewDimension?: GPUTextureViewDimension;
|
|
518
|
+
}
|
|
519
|
+
|
|
473
520
|
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
|
|
474
521
|
buffer: GPUBuffer;
|
|
475
522
|
}
|
|
@@ -487,6 +534,12 @@ interface GPUTexelCopyTextureInfo {
|
|
|
487
534
|
texture: GPUTexture;
|
|
488
535
|
}
|
|
489
536
|
|
|
537
|
+
interface GPUTextureBindingLayout {
|
|
538
|
+
multisampled?: boolean;
|
|
539
|
+
sampleType?: GPUTextureSampleType;
|
|
540
|
+
viewDimension?: GPUTextureViewDimension;
|
|
541
|
+
}
|
|
542
|
+
|
|
490
543
|
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
|
|
491
544
|
dimension?: GPUTextureDimension;
|
|
492
545
|
format: GPUTextureFormat;
|
|
@@ -4169,6 +4222,76 @@ declare var FormData: {
|
|
|
4169
4222
|
new(): FormData;
|
|
4170
4223
|
};
|
|
4171
4224
|
|
|
4225
|
+
/**
|
|
4226
|
+
* The **`GPU`** interface of the WebGPU API is the starting point for using WebGPU. It can be used to return a GPUAdapter from which you can request devices, configure features and limits, and more.
|
|
4227
|
+
* Available only in secure contexts.
|
|
4228
|
+
*
|
|
4229
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU)
|
|
4230
|
+
*/
|
|
4231
|
+
interface GPU {
|
|
4232
|
+
/**
|
|
4233
|
+
* The **`wgslLanguageFeatures`** read-only property of the GPU interface returns a WGSLLanguageFeatures object that reports the WGSL language extensions supported by the WebGPU implementation.
|
|
4234
|
+
*
|
|
4235
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/wgslLanguageFeatures)
|
|
4236
|
+
*/
|
|
4237
|
+
readonly wgslLanguageFeatures: WGSLLanguageFeatures;
|
|
4238
|
+
/**
|
|
4239
|
+
* The **`getPreferredCanvasFormat()`** method of the GPU interface returns the optimal canvas texture format for displaying 8-bit depth, standard dynamic range content on the current system.
|
|
4240
|
+
*
|
|
4241
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/getPreferredCanvasFormat)
|
|
4242
|
+
*/
|
|
4243
|
+
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
4244
|
+
/**
|
|
4245
|
+
* The **`requestAdapter()`** method of the GPU interface returns a Promise that fulfills with a GPUAdapter object instance. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4246
|
+
*
|
|
4247
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/requestAdapter)
|
|
4248
|
+
*/
|
|
4249
|
+
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
4250
|
+
}
|
|
4251
|
+
|
|
4252
|
+
declare var GPU: {
|
|
4253
|
+
prototype: GPU;
|
|
4254
|
+
new(): GPU;
|
|
4255
|
+
};
|
|
4256
|
+
|
|
4257
|
+
/**
|
|
4258
|
+
* The **`GPUAdapter`** interface of the WebGPU API represents a GPU adapter. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4259
|
+
* Available only in secure contexts.
|
|
4260
|
+
*
|
|
4261
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter)
|
|
4262
|
+
*/
|
|
4263
|
+
interface GPUAdapter {
|
|
4264
|
+
/**
|
|
4265
|
+
* The **`features`** read-only property of the GPUAdapter interface returns a GPUSupportedFeatures object that describes additional functionality supported by the adapter.
|
|
4266
|
+
*
|
|
4267
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/features)
|
|
4268
|
+
*/
|
|
4269
|
+
readonly features: GPUSupportedFeatures;
|
|
4270
|
+
/**
|
|
4271
|
+
* The **`info`** read-only property of the GPUAdapter interface returns a GPUAdapterInfo object containing identifying information about the adapter.
|
|
4272
|
+
*
|
|
4273
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/info)
|
|
4274
|
+
*/
|
|
4275
|
+
readonly info: GPUAdapterInfo;
|
|
4276
|
+
/**
|
|
4277
|
+
* The **`limits`** read-only property of the GPUAdapter interface returns a GPUSupportedLimits object that describes the limits supported by the adapter.
|
|
4278
|
+
*
|
|
4279
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/limits)
|
|
4280
|
+
*/
|
|
4281
|
+
readonly limits: GPUSupportedLimits;
|
|
4282
|
+
/**
|
|
4283
|
+
* The **`requestDevice()`** method of the GPUAdapter interface returns a Promise that fulfills with a GPUDevice object, which is the primary interface for communicating with the GPU.
|
|
4284
|
+
*
|
|
4285
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/requestDevice)
|
|
4286
|
+
*/
|
|
4287
|
+
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
declare var GPUAdapter: {
|
|
4291
|
+
prototype: GPUAdapter;
|
|
4292
|
+
new(): GPUAdapter;
|
|
4293
|
+
};
|
|
4294
|
+
|
|
4172
4295
|
/**
|
|
4173
4296
|
* The **`GPUAdapterInfo`** interface of the WebGPU API contains identifying information about a GPUAdapter.
|
|
4174
4297
|
* Available only in secure contexts.
|
|
@@ -4622,6 +4745,12 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
|
|
|
4622
4745
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroup)
|
|
4623
4746
|
*/
|
|
4624
4747
|
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
4748
|
+
/**
|
|
4749
|
+
* The **`createBindGroupLayout()`** method of the GPUDevice interface creates a GPUBindGroupLayout that defines the structure and purpose of related GPU resources such as buffers that will be used in a pipeline, and is used as a template when creating GPUBindGroups.
|
|
4750
|
+
*
|
|
4751
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroupLayout)
|
|
4752
|
+
*/
|
|
4753
|
+
createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout;
|
|
4625
4754
|
/**
|
|
4626
4755
|
* The **`createBuffer()`** method of the GPUDevice interface creates a GPUBuffer in which to store raw data to use in GPU operations.
|
|
4627
4756
|
*
|
|
@@ -6391,6 +6520,15 @@ interface NavigatorConcurrentHardware {
|
|
|
6391
6520
|
readonly hardwareConcurrency: number;
|
|
6392
6521
|
}
|
|
6393
6522
|
|
|
6523
|
+
interface NavigatorGPU {
|
|
6524
|
+
/**
|
|
6525
|
+
* Available only in secure contexts.
|
|
6526
|
+
*
|
|
6527
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/gpu)
|
|
6528
|
+
*/
|
|
6529
|
+
readonly gpu: GPU;
|
|
6530
|
+
}
|
|
6531
|
+
|
|
6394
6532
|
interface NavigatorID {
|
|
6395
6533
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/appCodeName) */
|
|
6396
6534
|
readonly appCodeName: string;
|
|
@@ -11923,7 +12061,7 @@ declare var WorkerLocation: {
|
|
|
11923
12061
|
*
|
|
11924
12062
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerNavigator)
|
|
11925
12063
|
*/
|
|
11926
|
-
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
12064
|
+
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
11927
12065
|
/**
|
|
11928
12066
|
* The read-only **`mediaCapabilities`** property of the WorkerNavigator interface references a MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities (as defined by the Media Capabilities API).
|
|
11929
12067
|
*
|
|
@@ -12892,6 +13030,7 @@ type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
|
|
|
12892
13030
|
type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
|
|
12893
13031
|
type GPUPipelineConstantValue = number;
|
|
12894
13032
|
type GPUSampleMask = number;
|
|
13033
|
+
type GPUShaderStageFlags = number;
|
|
12895
13034
|
type GPUSignedOffset32 = number;
|
|
12896
13035
|
type GPUSize32 = number;
|
|
12897
13036
|
type GPUSize32Out = number;
|
|
@@ -12947,6 +13086,7 @@ type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
|
|
|
12947
13086
|
type GPUAutoLayoutMode = "auto";
|
|
12948
13087
|
type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
|
|
12949
13088
|
type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
|
|
13089
|
+
type GPUBufferBindingType = "read-only-storage" | "storage" | "uniform";
|
|
12950
13090
|
type GPUBufferMapState = "mapped" | "pending" | "unmapped";
|
|
12951
13091
|
type GPUCanvasAlphaMode = "opaque" | "premultiplied";
|
|
12952
13092
|
type GPUCanvasToneMappingMode = "extended" | "standard";
|
|
@@ -12955,19 +13095,24 @@ type GPUCompilationMessageType = "error" | "info" | "warning";
|
|
|
12955
13095
|
type GPUCullMode = "back" | "front" | "none";
|
|
12956
13096
|
type GPUDeviceLostReason = "destroyed" | "unknown";
|
|
12957
13097
|
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
|
|
13098
|
+
type GPUFeatureName = "bgra8unorm-storage" | "clip-distances" | "core-features-and-limits" | "depth-clip-control" | "depth32float-stencil8" | "dual-source-blending" | "float32-blendable" | "float32-filterable" | "indirect-first-instance" | "primitive-index" | "rg11b10ufloat-renderable" | "shader-f16" | "subgroups" | "texture-compression-astc" | "texture-compression-astc-sliced-3d" | "texture-compression-bc" | "texture-compression-bc-sliced-3d" | "texture-compression-etc2" | "texture-formats-tier1" | "timestamp-query";
|
|
12958
13099
|
type GPUFilterMode = "linear" | "nearest";
|
|
12959
13100
|
type GPUFrontFace = "ccw" | "cw";
|
|
12960
13101
|
type GPUIndexFormat = "uint16" | "uint32";
|
|
12961
13102
|
type GPULoadOp = "clear" | "load";
|
|
12962
13103
|
type GPUMipmapFilterMode = "linear" | "nearest";
|
|
12963
13104
|
type GPUPipelineErrorReason = "internal" | "validation";
|
|
13105
|
+
type GPUPowerPreference = "high-performance" | "low-power";
|
|
12964
13106
|
type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
|
|
12965
13107
|
type GPUQueryType = "occlusion" | "timestamp";
|
|
13108
|
+
type GPUSamplerBindingType = "comparison" | "filtering" | "non-filtering";
|
|
12966
13109
|
type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
|
|
13110
|
+
type GPUStorageTextureAccess = "read-only" | "read-write" | "write-only";
|
|
12967
13111
|
type GPUStoreOp = "discard" | "store";
|
|
12968
13112
|
type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
|
|
12969
13113
|
type GPUTextureDimension = "1d" | "2d" | "3d";
|
|
12970
13114
|
type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";
|
|
13115
|
+
type GPUTextureSampleType = "depth" | "float" | "sint" | "uint" | "unfilterable-float";
|
|
12971
13116
|
type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
|
|
12972
13117
|
type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
|
|
12973
13118
|
type GPUVertexStepMode = "instance" | "vertex";
|
package/package.json
CHANGED
package/ts5.5/index.d.ts
CHANGED
|
@@ -226,6 +226,20 @@ interface GPUBindGroupEntry {
|
|
|
226
226
|
resource: GPUBindingResource;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
+
interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
230
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface GPUBindGroupLayoutEntry {
|
|
234
|
+
binding: GPUIndex32;
|
|
235
|
+
buffer?: GPUBufferBindingLayout;
|
|
236
|
+
externalTexture?: GPUExternalTextureBindingLayout;
|
|
237
|
+
sampler?: GPUSamplerBindingLayout;
|
|
238
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
239
|
+
texture?: GPUTextureBindingLayout;
|
|
240
|
+
visibility: GPUShaderStageFlags;
|
|
241
|
+
}
|
|
242
|
+
|
|
229
243
|
interface GPUBlendComponent {
|
|
230
244
|
dstFactor?: GPUBlendFactor;
|
|
231
245
|
operation?: GPUBlendOperation;
|
|
@@ -243,6 +257,12 @@ interface GPUBufferBinding {
|
|
|
243
257
|
size?: GPUSize64;
|
|
244
258
|
}
|
|
245
259
|
|
|
260
|
+
interface GPUBufferBindingLayout {
|
|
261
|
+
hasDynamicOffset?: boolean;
|
|
262
|
+
minBindingSize?: GPUSize64;
|
|
263
|
+
type?: GPUBufferBindingType;
|
|
264
|
+
}
|
|
265
|
+
|
|
246
266
|
interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
|
|
247
267
|
mappedAtCreation?: boolean;
|
|
248
268
|
size: GPUSize64;
|
|
@@ -320,12 +340,21 @@ interface GPUDepthStencilState {
|
|
|
320
340
|
stencilWriteMask?: GPUStencilValue;
|
|
321
341
|
}
|
|
322
342
|
|
|
343
|
+
interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
|
|
344
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
345
|
+
requiredFeatures?: GPUFeatureName[];
|
|
346
|
+
requiredLimits?: Record<string, GPUSize64 | undefined>;
|
|
347
|
+
}
|
|
348
|
+
|
|
323
349
|
interface GPUExtent3DDict {
|
|
324
350
|
depthOrArrayLayers?: GPUIntegerCoordinate;
|
|
325
351
|
height?: GPUIntegerCoordinate;
|
|
326
352
|
width: GPUIntegerCoordinate;
|
|
327
353
|
}
|
|
328
354
|
|
|
355
|
+
interface GPUExternalTextureBindingLayout {
|
|
356
|
+
}
|
|
357
|
+
|
|
329
358
|
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
|
|
330
359
|
colorSpace?: PredefinedColorSpace;
|
|
331
360
|
}
|
|
@@ -386,6 +415,9 @@ interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
|
|
|
386
415
|
type: GPUQueryType;
|
|
387
416
|
}
|
|
388
417
|
|
|
418
|
+
interface GPUQueueDescriptor extends GPUObjectDescriptorBase {
|
|
419
|
+
}
|
|
420
|
+
|
|
389
421
|
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
|
|
390
422
|
}
|
|
391
423
|
|
|
@@ -443,6 +475,15 @@ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
|
|
|
443
475
|
vertex: GPUVertexState;
|
|
444
476
|
}
|
|
445
477
|
|
|
478
|
+
interface GPURequestAdapterOptions {
|
|
479
|
+
forceFallbackAdapter?: boolean;
|
|
480
|
+
powerPreference?: GPUPowerPreference;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
interface GPUSamplerBindingLayout {
|
|
484
|
+
type?: GPUSamplerBindingType;
|
|
485
|
+
}
|
|
486
|
+
|
|
446
487
|
interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
|
|
447
488
|
addressModeU?: GPUAddressMode;
|
|
448
489
|
addressModeV?: GPUAddressMode;
|
|
@@ -467,6 +508,12 @@ interface GPUStencilFaceState {
|
|
|
467
508
|
passOp?: GPUStencilOperation;
|
|
468
509
|
}
|
|
469
510
|
|
|
511
|
+
interface GPUStorageTextureBindingLayout {
|
|
512
|
+
access?: GPUStorageTextureAccess;
|
|
513
|
+
format: GPUTextureFormat;
|
|
514
|
+
viewDimension?: GPUTextureViewDimension;
|
|
515
|
+
}
|
|
516
|
+
|
|
470
517
|
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
|
|
471
518
|
buffer: GPUBuffer;
|
|
472
519
|
}
|
|
@@ -484,6 +531,12 @@ interface GPUTexelCopyTextureInfo {
|
|
|
484
531
|
texture: GPUTexture;
|
|
485
532
|
}
|
|
486
533
|
|
|
534
|
+
interface GPUTextureBindingLayout {
|
|
535
|
+
multisampled?: boolean;
|
|
536
|
+
sampleType?: GPUTextureSampleType;
|
|
537
|
+
viewDimension?: GPUTextureViewDimension;
|
|
538
|
+
}
|
|
539
|
+
|
|
487
540
|
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
|
|
488
541
|
dimension?: GPUTextureDimension;
|
|
489
542
|
format: GPUTextureFormat;
|
|
@@ -4166,6 +4219,76 @@ declare var FormData: {
|
|
|
4166
4219
|
new(): FormData;
|
|
4167
4220
|
};
|
|
4168
4221
|
|
|
4222
|
+
/**
|
|
4223
|
+
* The **`GPU`** interface of the WebGPU API is the starting point for using WebGPU. It can be used to return a GPUAdapter from which you can request devices, configure features and limits, and more.
|
|
4224
|
+
* Available only in secure contexts.
|
|
4225
|
+
*
|
|
4226
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU)
|
|
4227
|
+
*/
|
|
4228
|
+
interface GPU {
|
|
4229
|
+
/**
|
|
4230
|
+
* The **`wgslLanguageFeatures`** read-only property of the GPU interface returns a WGSLLanguageFeatures object that reports the WGSL language extensions supported by the WebGPU implementation.
|
|
4231
|
+
*
|
|
4232
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/wgslLanguageFeatures)
|
|
4233
|
+
*/
|
|
4234
|
+
readonly wgslLanguageFeatures: WGSLLanguageFeatures;
|
|
4235
|
+
/**
|
|
4236
|
+
* The **`getPreferredCanvasFormat()`** method of the GPU interface returns the optimal canvas texture format for displaying 8-bit depth, standard dynamic range content on the current system.
|
|
4237
|
+
*
|
|
4238
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/getPreferredCanvasFormat)
|
|
4239
|
+
*/
|
|
4240
|
+
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
4241
|
+
/**
|
|
4242
|
+
* The **`requestAdapter()`** method of the GPU interface returns a Promise that fulfills with a GPUAdapter object instance. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4243
|
+
*
|
|
4244
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/requestAdapter)
|
|
4245
|
+
*/
|
|
4246
|
+
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
4247
|
+
}
|
|
4248
|
+
|
|
4249
|
+
declare var GPU: {
|
|
4250
|
+
prototype: GPU;
|
|
4251
|
+
new(): GPU;
|
|
4252
|
+
};
|
|
4253
|
+
|
|
4254
|
+
/**
|
|
4255
|
+
* The **`GPUAdapter`** interface of the WebGPU API represents a GPU adapter. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4256
|
+
* Available only in secure contexts.
|
|
4257
|
+
*
|
|
4258
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter)
|
|
4259
|
+
*/
|
|
4260
|
+
interface GPUAdapter {
|
|
4261
|
+
/**
|
|
4262
|
+
* The **`features`** read-only property of the GPUAdapter interface returns a GPUSupportedFeatures object that describes additional functionality supported by the adapter.
|
|
4263
|
+
*
|
|
4264
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/features)
|
|
4265
|
+
*/
|
|
4266
|
+
readonly features: GPUSupportedFeatures;
|
|
4267
|
+
/**
|
|
4268
|
+
* The **`info`** read-only property of the GPUAdapter interface returns a GPUAdapterInfo object containing identifying information about the adapter.
|
|
4269
|
+
*
|
|
4270
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/info)
|
|
4271
|
+
*/
|
|
4272
|
+
readonly info: GPUAdapterInfo;
|
|
4273
|
+
/**
|
|
4274
|
+
* The **`limits`** read-only property of the GPUAdapter interface returns a GPUSupportedLimits object that describes the limits supported by the adapter.
|
|
4275
|
+
*
|
|
4276
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/limits)
|
|
4277
|
+
*/
|
|
4278
|
+
readonly limits: GPUSupportedLimits;
|
|
4279
|
+
/**
|
|
4280
|
+
* The **`requestDevice()`** method of the GPUAdapter interface returns a Promise that fulfills with a GPUDevice object, which is the primary interface for communicating with the GPU.
|
|
4281
|
+
*
|
|
4282
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/requestDevice)
|
|
4283
|
+
*/
|
|
4284
|
+
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
declare var GPUAdapter: {
|
|
4288
|
+
prototype: GPUAdapter;
|
|
4289
|
+
new(): GPUAdapter;
|
|
4290
|
+
};
|
|
4291
|
+
|
|
4169
4292
|
/**
|
|
4170
4293
|
* The **`GPUAdapterInfo`** interface of the WebGPU API contains identifying information about a GPUAdapter.
|
|
4171
4294
|
* Available only in secure contexts.
|
|
@@ -4619,6 +4742,12 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
|
|
|
4619
4742
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroup)
|
|
4620
4743
|
*/
|
|
4621
4744
|
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
4745
|
+
/**
|
|
4746
|
+
* The **`createBindGroupLayout()`** method of the GPUDevice interface creates a GPUBindGroupLayout that defines the structure and purpose of related GPU resources such as buffers that will be used in a pipeline, and is used as a template when creating GPUBindGroups.
|
|
4747
|
+
*
|
|
4748
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroupLayout)
|
|
4749
|
+
*/
|
|
4750
|
+
createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout;
|
|
4622
4751
|
/**
|
|
4623
4752
|
* The **`createBuffer()`** method of the GPUDevice interface creates a GPUBuffer in which to store raw data to use in GPU operations.
|
|
4624
4753
|
*
|
|
@@ -6388,6 +6517,15 @@ interface NavigatorConcurrentHardware {
|
|
|
6388
6517
|
readonly hardwareConcurrency: number;
|
|
6389
6518
|
}
|
|
6390
6519
|
|
|
6520
|
+
interface NavigatorGPU {
|
|
6521
|
+
/**
|
|
6522
|
+
* Available only in secure contexts.
|
|
6523
|
+
*
|
|
6524
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/gpu)
|
|
6525
|
+
*/
|
|
6526
|
+
readonly gpu: GPU;
|
|
6527
|
+
}
|
|
6528
|
+
|
|
6391
6529
|
interface NavigatorID {
|
|
6392
6530
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/appCodeName) */
|
|
6393
6531
|
readonly appCodeName: string;
|
|
@@ -11920,7 +12058,7 @@ declare var WorkerLocation: {
|
|
|
11920
12058
|
*
|
|
11921
12059
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerNavigator)
|
|
11922
12060
|
*/
|
|
11923
|
-
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
12061
|
+
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
11924
12062
|
/**
|
|
11925
12063
|
* The read-only **`mediaCapabilities`** property of the WorkerNavigator interface references a MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities (as defined by the Media Capabilities API).
|
|
11926
12064
|
*
|
|
@@ -12889,6 +13027,7 @@ type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
|
|
|
12889
13027
|
type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
|
|
12890
13028
|
type GPUPipelineConstantValue = number;
|
|
12891
13029
|
type GPUSampleMask = number;
|
|
13030
|
+
type GPUShaderStageFlags = number;
|
|
12892
13031
|
type GPUSignedOffset32 = number;
|
|
12893
13032
|
type GPUSize32 = number;
|
|
12894
13033
|
type GPUSize32Out = number;
|
|
@@ -12944,6 +13083,7 @@ type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
|
|
|
12944
13083
|
type GPUAutoLayoutMode = "auto";
|
|
12945
13084
|
type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
|
|
12946
13085
|
type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
|
|
13086
|
+
type GPUBufferBindingType = "read-only-storage" | "storage" | "uniform";
|
|
12947
13087
|
type GPUBufferMapState = "mapped" | "pending" | "unmapped";
|
|
12948
13088
|
type GPUCanvasAlphaMode = "opaque" | "premultiplied";
|
|
12949
13089
|
type GPUCanvasToneMappingMode = "extended" | "standard";
|
|
@@ -12952,19 +13092,24 @@ type GPUCompilationMessageType = "error" | "info" | "warning";
|
|
|
12952
13092
|
type GPUCullMode = "back" | "front" | "none";
|
|
12953
13093
|
type GPUDeviceLostReason = "destroyed" | "unknown";
|
|
12954
13094
|
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
|
|
13095
|
+
type GPUFeatureName = "bgra8unorm-storage" | "clip-distances" | "core-features-and-limits" | "depth-clip-control" | "depth32float-stencil8" | "dual-source-blending" | "float32-blendable" | "float32-filterable" | "indirect-first-instance" | "primitive-index" | "rg11b10ufloat-renderable" | "shader-f16" | "subgroups" | "texture-compression-astc" | "texture-compression-astc-sliced-3d" | "texture-compression-bc" | "texture-compression-bc-sliced-3d" | "texture-compression-etc2" | "texture-formats-tier1" | "timestamp-query";
|
|
12955
13096
|
type GPUFilterMode = "linear" | "nearest";
|
|
12956
13097
|
type GPUFrontFace = "ccw" | "cw";
|
|
12957
13098
|
type GPUIndexFormat = "uint16" | "uint32";
|
|
12958
13099
|
type GPULoadOp = "clear" | "load";
|
|
12959
13100
|
type GPUMipmapFilterMode = "linear" | "nearest";
|
|
12960
13101
|
type GPUPipelineErrorReason = "internal" | "validation";
|
|
13102
|
+
type GPUPowerPreference = "high-performance" | "low-power";
|
|
12961
13103
|
type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
|
|
12962
13104
|
type GPUQueryType = "occlusion" | "timestamp";
|
|
13105
|
+
type GPUSamplerBindingType = "comparison" | "filtering" | "non-filtering";
|
|
12963
13106
|
type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
|
|
13107
|
+
type GPUStorageTextureAccess = "read-only" | "read-write" | "write-only";
|
|
12964
13108
|
type GPUStoreOp = "discard" | "store";
|
|
12965
13109
|
type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
|
|
12966
13110
|
type GPUTextureDimension = "1d" | "2d" | "3d";
|
|
12967
13111
|
type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";
|
|
13112
|
+
type GPUTextureSampleType = "depth" | "float" | "sint" | "uint" | "unfilterable-float";
|
|
12968
13113
|
type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
|
|
12969
13114
|
type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
|
|
12970
13115
|
type GPUVertexStepMode = "instance" | "vertex";
|
package/ts5.6/index.d.ts
CHANGED
|
@@ -226,6 +226,20 @@ interface GPUBindGroupEntry {
|
|
|
226
226
|
resource: GPUBindingResource;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
+
interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
230
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface GPUBindGroupLayoutEntry {
|
|
234
|
+
binding: GPUIndex32;
|
|
235
|
+
buffer?: GPUBufferBindingLayout;
|
|
236
|
+
externalTexture?: GPUExternalTextureBindingLayout;
|
|
237
|
+
sampler?: GPUSamplerBindingLayout;
|
|
238
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
239
|
+
texture?: GPUTextureBindingLayout;
|
|
240
|
+
visibility: GPUShaderStageFlags;
|
|
241
|
+
}
|
|
242
|
+
|
|
229
243
|
interface GPUBlendComponent {
|
|
230
244
|
dstFactor?: GPUBlendFactor;
|
|
231
245
|
operation?: GPUBlendOperation;
|
|
@@ -243,6 +257,12 @@ interface GPUBufferBinding {
|
|
|
243
257
|
size?: GPUSize64;
|
|
244
258
|
}
|
|
245
259
|
|
|
260
|
+
interface GPUBufferBindingLayout {
|
|
261
|
+
hasDynamicOffset?: boolean;
|
|
262
|
+
minBindingSize?: GPUSize64;
|
|
263
|
+
type?: GPUBufferBindingType;
|
|
264
|
+
}
|
|
265
|
+
|
|
246
266
|
interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
|
|
247
267
|
mappedAtCreation?: boolean;
|
|
248
268
|
size: GPUSize64;
|
|
@@ -320,12 +340,21 @@ interface GPUDepthStencilState {
|
|
|
320
340
|
stencilWriteMask?: GPUStencilValue;
|
|
321
341
|
}
|
|
322
342
|
|
|
343
|
+
interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
|
|
344
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
345
|
+
requiredFeatures?: GPUFeatureName[];
|
|
346
|
+
requiredLimits?: Record<string, GPUSize64 | undefined>;
|
|
347
|
+
}
|
|
348
|
+
|
|
323
349
|
interface GPUExtent3DDict {
|
|
324
350
|
depthOrArrayLayers?: GPUIntegerCoordinate;
|
|
325
351
|
height?: GPUIntegerCoordinate;
|
|
326
352
|
width: GPUIntegerCoordinate;
|
|
327
353
|
}
|
|
328
354
|
|
|
355
|
+
interface GPUExternalTextureBindingLayout {
|
|
356
|
+
}
|
|
357
|
+
|
|
329
358
|
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
|
|
330
359
|
colorSpace?: PredefinedColorSpace;
|
|
331
360
|
}
|
|
@@ -386,6 +415,9 @@ interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
|
|
|
386
415
|
type: GPUQueryType;
|
|
387
416
|
}
|
|
388
417
|
|
|
418
|
+
interface GPUQueueDescriptor extends GPUObjectDescriptorBase {
|
|
419
|
+
}
|
|
420
|
+
|
|
389
421
|
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
|
|
390
422
|
}
|
|
391
423
|
|
|
@@ -443,6 +475,15 @@ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
|
|
|
443
475
|
vertex: GPUVertexState;
|
|
444
476
|
}
|
|
445
477
|
|
|
478
|
+
interface GPURequestAdapterOptions {
|
|
479
|
+
forceFallbackAdapter?: boolean;
|
|
480
|
+
powerPreference?: GPUPowerPreference;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
interface GPUSamplerBindingLayout {
|
|
484
|
+
type?: GPUSamplerBindingType;
|
|
485
|
+
}
|
|
486
|
+
|
|
446
487
|
interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
|
|
447
488
|
addressModeU?: GPUAddressMode;
|
|
448
489
|
addressModeV?: GPUAddressMode;
|
|
@@ -467,6 +508,12 @@ interface GPUStencilFaceState {
|
|
|
467
508
|
passOp?: GPUStencilOperation;
|
|
468
509
|
}
|
|
469
510
|
|
|
511
|
+
interface GPUStorageTextureBindingLayout {
|
|
512
|
+
access?: GPUStorageTextureAccess;
|
|
513
|
+
format: GPUTextureFormat;
|
|
514
|
+
viewDimension?: GPUTextureViewDimension;
|
|
515
|
+
}
|
|
516
|
+
|
|
470
517
|
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
|
|
471
518
|
buffer: GPUBuffer;
|
|
472
519
|
}
|
|
@@ -484,6 +531,12 @@ interface GPUTexelCopyTextureInfo {
|
|
|
484
531
|
texture: GPUTexture;
|
|
485
532
|
}
|
|
486
533
|
|
|
534
|
+
interface GPUTextureBindingLayout {
|
|
535
|
+
multisampled?: boolean;
|
|
536
|
+
sampleType?: GPUTextureSampleType;
|
|
537
|
+
viewDimension?: GPUTextureViewDimension;
|
|
538
|
+
}
|
|
539
|
+
|
|
487
540
|
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
|
|
488
541
|
dimension?: GPUTextureDimension;
|
|
489
542
|
format: GPUTextureFormat;
|
|
@@ -4166,6 +4219,76 @@ declare var FormData: {
|
|
|
4166
4219
|
new(): FormData;
|
|
4167
4220
|
};
|
|
4168
4221
|
|
|
4222
|
+
/**
|
|
4223
|
+
* The **`GPU`** interface of the WebGPU API is the starting point for using WebGPU. It can be used to return a GPUAdapter from which you can request devices, configure features and limits, and more.
|
|
4224
|
+
* Available only in secure contexts.
|
|
4225
|
+
*
|
|
4226
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU)
|
|
4227
|
+
*/
|
|
4228
|
+
interface GPU {
|
|
4229
|
+
/**
|
|
4230
|
+
* The **`wgslLanguageFeatures`** read-only property of the GPU interface returns a WGSLLanguageFeatures object that reports the WGSL language extensions supported by the WebGPU implementation.
|
|
4231
|
+
*
|
|
4232
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/wgslLanguageFeatures)
|
|
4233
|
+
*/
|
|
4234
|
+
readonly wgslLanguageFeatures: WGSLLanguageFeatures;
|
|
4235
|
+
/**
|
|
4236
|
+
* The **`getPreferredCanvasFormat()`** method of the GPU interface returns the optimal canvas texture format for displaying 8-bit depth, standard dynamic range content on the current system.
|
|
4237
|
+
*
|
|
4238
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/getPreferredCanvasFormat)
|
|
4239
|
+
*/
|
|
4240
|
+
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
4241
|
+
/**
|
|
4242
|
+
* The **`requestAdapter()`** method of the GPU interface returns a Promise that fulfills with a GPUAdapter object instance. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4243
|
+
*
|
|
4244
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/requestAdapter)
|
|
4245
|
+
*/
|
|
4246
|
+
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
4247
|
+
}
|
|
4248
|
+
|
|
4249
|
+
declare var GPU: {
|
|
4250
|
+
prototype: GPU;
|
|
4251
|
+
new(): GPU;
|
|
4252
|
+
};
|
|
4253
|
+
|
|
4254
|
+
/**
|
|
4255
|
+
* The **`GPUAdapter`** interface of the WebGPU API represents a GPU adapter. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4256
|
+
* Available only in secure contexts.
|
|
4257
|
+
*
|
|
4258
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter)
|
|
4259
|
+
*/
|
|
4260
|
+
interface GPUAdapter {
|
|
4261
|
+
/**
|
|
4262
|
+
* The **`features`** read-only property of the GPUAdapter interface returns a GPUSupportedFeatures object that describes additional functionality supported by the adapter.
|
|
4263
|
+
*
|
|
4264
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/features)
|
|
4265
|
+
*/
|
|
4266
|
+
readonly features: GPUSupportedFeatures;
|
|
4267
|
+
/**
|
|
4268
|
+
* The **`info`** read-only property of the GPUAdapter interface returns a GPUAdapterInfo object containing identifying information about the adapter.
|
|
4269
|
+
*
|
|
4270
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/info)
|
|
4271
|
+
*/
|
|
4272
|
+
readonly info: GPUAdapterInfo;
|
|
4273
|
+
/**
|
|
4274
|
+
* The **`limits`** read-only property of the GPUAdapter interface returns a GPUSupportedLimits object that describes the limits supported by the adapter.
|
|
4275
|
+
*
|
|
4276
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/limits)
|
|
4277
|
+
*/
|
|
4278
|
+
readonly limits: GPUSupportedLimits;
|
|
4279
|
+
/**
|
|
4280
|
+
* The **`requestDevice()`** method of the GPUAdapter interface returns a Promise that fulfills with a GPUDevice object, which is the primary interface for communicating with the GPU.
|
|
4281
|
+
*
|
|
4282
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/requestDevice)
|
|
4283
|
+
*/
|
|
4284
|
+
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
declare var GPUAdapter: {
|
|
4288
|
+
prototype: GPUAdapter;
|
|
4289
|
+
new(): GPUAdapter;
|
|
4290
|
+
};
|
|
4291
|
+
|
|
4169
4292
|
/**
|
|
4170
4293
|
* The **`GPUAdapterInfo`** interface of the WebGPU API contains identifying information about a GPUAdapter.
|
|
4171
4294
|
* Available only in secure contexts.
|
|
@@ -4619,6 +4742,12 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
|
|
|
4619
4742
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroup)
|
|
4620
4743
|
*/
|
|
4621
4744
|
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
4745
|
+
/**
|
|
4746
|
+
* The **`createBindGroupLayout()`** method of the GPUDevice interface creates a GPUBindGroupLayout that defines the structure and purpose of related GPU resources such as buffers that will be used in a pipeline, and is used as a template when creating GPUBindGroups.
|
|
4747
|
+
*
|
|
4748
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroupLayout)
|
|
4749
|
+
*/
|
|
4750
|
+
createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout;
|
|
4622
4751
|
/**
|
|
4623
4752
|
* The **`createBuffer()`** method of the GPUDevice interface creates a GPUBuffer in which to store raw data to use in GPU operations.
|
|
4624
4753
|
*
|
|
@@ -6388,6 +6517,15 @@ interface NavigatorConcurrentHardware {
|
|
|
6388
6517
|
readonly hardwareConcurrency: number;
|
|
6389
6518
|
}
|
|
6390
6519
|
|
|
6520
|
+
interface NavigatorGPU {
|
|
6521
|
+
/**
|
|
6522
|
+
* Available only in secure contexts.
|
|
6523
|
+
*
|
|
6524
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/gpu)
|
|
6525
|
+
*/
|
|
6526
|
+
readonly gpu: GPU;
|
|
6527
|
+
}
|
|
6528
|
+
|
|
6391
6529
|
interface NavigatorID {
|
|
6392
6530
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/appCodeName) */
|
|
6393
6531
|
readonly appCodeName: string;
|
|
@@ -11920,7 +12058,7 @@ declare var WorkerLocation: {
|
|
|
11920
12058
|
*
|
|
11921
12059
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerNavigator)
|
|
11922
12060
|
*/
|
|
11923
|
-
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
12061
|
+
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
11924
12062
|
/**
|
|
11925
12063
|
* The read-only **`mediaCapabilities`** property of the WorkerNavigator interface references a MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities (as defined by the Media Capabilities API).
|
|
11926
12064
|
*
|
|
@@ -12889,6 +13027,7 @@ type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
|
|
|
12889
13027
|
type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
|
|
12890
13028
|
type GPUPipelineConstantValue = number;
|
|
12891
13029
|
type GPUSampleMask = number;
|
|
13030
|
+
type GPUShaderStageFlags = number;
|
|
12892
13031
|
type GPUSignedOffset32 = number;
|
|
12893
13032
|
type GPUSize32 = number;
|
|
12894
13033
|
type GPUSize32Out = number;
|
|
@@ -12944,6 +13083,7 @@ type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
|
|
|
12944
13083
|
type GPUAutoLayoutMode = "auto";
|
|
12945
13084
|
type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
|
|
12946
13085
|
type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
|
|
13086
|
+
type GPUBufferBindingType = "read-only-storage" | "storage" | "uniform";
|
|
12947
13087
|
type GPUBufferMapState = "mapped" | "pending" | "unmapped";
|
|
12948
13088
|
type GPUCanvasAlphaMode = "opaque" | "premultiplied";
|
|
12949
13089
|
type GPUCanvasToneMappingMode = "extended" | "standard";
|
|
@@ -12952,19 +13092,24 @@ type GPUCompilationMessageType = "error" | "info" | "warning";
|
|
|
12952
13092
|
type GPUCullMode = "back" | "front" | "none";
|
|
12953
13093
|
type GPUDeviceLostReason = "destroyed" | "unknown";
|
|
12954
13094
|
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
|
|
13095
|
+
type GPUFeatureName = "bgra8unorm-storage" | "clip-distances" | "core-features-and-limits" | "depth-clip-control" | "depth32float-stencil8" | "dual-source-blending" | "float32-blendable" | "float32-filterable" | "indirect-first-instance" | "primitive-index" | "rg11b10ufloat-renderable" | "shader-f16" | "subgroups" | "texture-compression-astc" | "texture-compression-astc-sliced-3d" | "texture-compression-bc" | "texture-compression-bc-sliced-3d" | "texture-compression-etc2" | "texture-formats-tier1" | "timestamp-query";
|
|
12955
13096
|
type GPUFilterMode = "linear" | "nearest";
|
|
12956
13097
|
type GPUFrontFace = "ccw" | "cw";
|
|
12957
13098
|
type GPUIndexFormat = "uint16" | "uint32";
|
|
12958
13099
|
type GPULoadOp = "clear" | "load";
|
|
12959
13100
|
type GPUMipmapFilterMode = "linear" | "nearest";
|
|
12960
13101
|
type GPUPipelineErrorReason = "internal" | "validation";
|
|
13102
|
+
type GPUPowerPreference = "high-performance" | "low-power";
|
|
12961
13103
|
type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
|
|
12962
13104
|
type GPUQueryType = "occlusion" | "timestamp";
|
|
13105
|
+
type GPUSamplerBindingType = "comparison" | "filtering" | "non-filtering";
|
|
12963
13106
|
type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
|
|
13107
|
+
type GPUStorageTextureAccess = "read-only" | "read-write" | "write-only";
|
|
12964
13108
|
type GPUStoreOp = "discard" | "store";
|
|
12965
13109
|
type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
|
|
12966
13110
|
type GPUTextureDimension = "1d" | "2d" | "3d";
|
|
12967
13111
|
type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";
|
|
13112
|
+
type GPUTextureSampleType = "depth" | "float" | "sint" | "uint" | "unfilterable-float";
|
|
12968
13113
|
type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
|
|
12969
13114
|
type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
|
|
12970
13115
|
type GPUVertexStepMode = "instance" | "vertex";
|
package/ts5.9/index.d.ts
CHANGED
|
@@ -226,6 +226,20 @@ interface GPUBindGroupEntry {
|
|
|
226
226
|
resource: GPUBindingResource;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
+
interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
230
|
+
entries: GPUBindGroupLayoutEntry[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface GPUBindGroupLayoutEntry {
|
|
234
|
+
binding: GPUIndex32;
|
|
235
|
+
buffer?: GPUBufferBindingLayout;
|
|
236
|
+
externalTexture?: GPUExternalTextureBindingLayout;
|
|
237
|
+
sampler?: GPUSamplerBindingLayout;
|
|
238
|
+
storageTexture?: GPUStorageTextureBindingLayout;
|
|
239
|
+
texture?: GPUTextureBindingLayout;
|
|
240
|
+
visibility: GPUShaderStageFlags;
|
|
241
|
+
}
|
|
242
|
+
|
|
229
243
|
interface GPUBlendComponent {
|
|
230
244
|
dstFactor?: GPUBlendFactor;
|
|
231
245
|
operation?: GPUBlendOperation;
|
|
@@ -243,6 +257,12 @@ interface GPUBufferBinding {
|
|
|
243
257
|
size?: GPUSize64;
|
|
244
258
|
}
|
|
245
259
|
|
|
260
|
+
interface GPUBufferBindingLayout {
|
|
261
|
+
hasDynamicOffset?: boolean;
|
|
262
|
+
minBindingSize?: GPUSize64;
|
|
263
|
+
type?: GPUBufferBindingType;
|
|
264
|
+
}
|
|
265
|
+
|
|
246
266
|
interface GPUBufferDescriptor extends GPUObjectDescriptorBase {
|
|
247
267
|
mappedAtCreation?: boolean;
|
|
248
268
|
size: GPUSize64;
|
|
@@ -320,12 +340,21 @@ interface GPUDepthStencilState {
|
|
|
320
340
|
stencilWriteMask?: GPUStencilValue;
|
|
321
341
|
}
|
|
322
342
|
|
|
343
|
+
interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
|
|
344
|
+
defaultQueue?: GPUQueueDescriptor;
|
|
345
|
+
requiredFeatures?: GPUFeatureName[];
|
|
346
|
+
requiredLimits?: Record<string, GPUSize64 | undefined>;
|
|
347
|
+
}
|
|
348
|
+
|
|
323
349
|
interface GPUExtent3DDict {
|
|
324
350
|
depthOrArrayLayers?: GPUIntegerCoordinate;
|
|
325
351
|
height?: GPUIntegerCoordinate;
|
|
326
352
|
width: GPUIntegerCoordinate;
|
|
327
353
|
}
|
|
328
354
|
|
|
355
|
+
interface GPUExternalTextureBindingLayout {
|
|
356
|
+
}
|
|
357
|
+
|
|
329
358
|
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
|
|
330
359
|
colorSpace?: PredefinedColorSpace;
|
|
331
360
|
}
|
|
@@ -386,6 +415,9 @@ interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
|
|
|
386
415
|
type: GPUQueryType;
|
|
387
416
|
}
|
|
388
417
|
|
|
418
|
+
interface GPUQueueDescriptor extends GPUObjectDescriptorBase {
|
|
419
|
+
}
|
|
420
|
+
|
|
389
421
|
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
|
|
390
422
|
}
|
|
391
423
|
|
|
@@ -443,6 +475,15 @@ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
|
|
|
443
475
|
vertex: GPUVertexState;
|
|
444
476
|
}
|
|
445
477
|
|
|
478
|
+
interface GPURequestAdapterOptions {
|
|
479
|
+
forceFallbackAdapter?: boolean;
|
|
480
|
+
powerPreference?: GPUPowerPreference;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
interface GPUSamplerBindingLayout {
|
|
484
|
+
type?: GPUSamplerBindingType;
|
|
485
|
+
}
|
|
486
|
+
|
|
446
487
|
interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
|
|
447
488
|
addressModeU?: GPUAddressMode;
|
|
448
489
|
addressModeV?: GPUAddressMode;
|
|
@@ -467,6 +508,12 @@ interface GPUStencilFaceState {
|
|
|
467
508
|
passOp?: GPUStencilOperation;
|
|
468
509
|
}
|
|
469
510
|
|
|
511
|
+
interface GPUStorageTextureBindingLayout {
|
|
512
|
+
access?: GPUStorageTextureAccess;
|
|
513
|
+
format: GPUTextureFormat;
|
|
514
|
+
viewDimension?: GPUTextureViewDimension;
|
|
515
|
+
}
|
|
516
|
+
|
|
470
517
|
interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
|
|
471
518
|
buffer: GPUBuffer;
|
|
472
519
|
}
|
|
@@ -484,6 +531,12 @@ interface GPUTexelCopyTextureInfo {
|
|
|
484
531
|
texture: GPUTexture;
|
|
485
532
|
}
|
|
486
533
|
|
|
534
|
+
interface GPUTextureBindingLayout {
|
|
535
|
+
multisampled?: boolean;
|
|
536
|
+
sampleType?: GPUTextureSampleType;
|
|
537
|
+
viewDimension?: GPUTextureViewDimension;
|
|
538
|
+
}
|
|
539
|
+
|
|
487
540
|
interface GPUTextureDescriptor extends GPUObjectDescriptorBase {
|
|
488
541
|
dimension?: GPUTextureDimension;
|
|
489
542
|
format: GPUTextureFormat;
|
|
@@ -4166,6 +4219,76 @@ declare var FormData: {
|
|
|
4166
4219
|
new(): FormData;
|
|
4167
4220
|
};
|
|
4168
4221
|
|
|
4222
|
+
/**
|
|
4223
|
+
* The **`GPU`** interface of the WebGPU API is the starting point for using WebGPU. It can be used to return a GPUAdapter from which you can request devices, configure features and limits, and more.
|
|
4224
|
+
* Available only in secure contexts.
|
|
4225
|
+
*
|
|
4226
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU)
|
|
4227
|
+
*/
|
|
4228
|
+
interface GPU {
|
|
4229
|
+
/**
|
|
4230
|
+
* The **`wgslLanguageFeatures`** read-only property of the GPU interface returns a WGSLLanguageFeatures object that reports the WGSL language extensions supported by the WebGPU implementation.
|
|
4231
|
+
*
|
|
4232
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/wgslLanguageFeatures)
|
|
4233
|
+
*/
|
|
4234
|
+
readonly wgslLanguageFeatures: WGSLLanguageFeatures;
|
|
4235
|
+
/**
|
|
4236
|
+
* The **`getPreferredCanvasFormat()`** method of the GPU interface returns the optimal canvas texture format for displaying 8-bit depth, standard dynamic range content on the current system.
|
|
4237
|
+
*
|
|
4238
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/getPreferredCanvasFormat)
|
|
4239
|
+
*/
|
|
4240
|
+
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
4241
|
+
/**
|
|
4242
|
+
* The **`requestAdapter()`** method of the GPU interface returns a Promise that fulfills with a GPUAdapter object instance. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4243
|
+
*
|
|
4244
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPU/requestAdapter)
|
|
4245
|
+
*/
|
|
4246
|
+
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
4247
|
+
}
|
|
4248
|
+
|
|
4249
|
+
declare var GPU: {
|
|
4250
|
+
prototype: GPU;
|
|
4251
|
+
new(): GPU;
|
|
4252
|
+
};
|
|
4253
|
+
|
|
4254
|
+
/**
|
|
4255
|
+
* The **`GPUAdapter`** interface of the WebGPU API represents a GPU adapter. From this you can request a GPUDevice, adapter info, features, and limits.
|
|
4256
|
+
* Available only in secure contexts.
|
|
4257
|
+
*
|
|
4258
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter)
|
|
4259
|
+
*/
|
|
4260
|
+
interface GPUAdapter {
|
|
4261
|
+
/**
|
|
4262
|
+
* The **`features`** read-only property of the GPUAdapter interface returns a GPUSupportedFeatures object that describes additional functionality supported by the adapter.
|
|
4263
|
+
*
|
|
4264
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/features)
|
|
4265
|
+
*/
|
|
4266
|
+
readonly features: GPUSupportedFeatures;
|
|
4267
|
+
/**
|
|
4268
|
+
* The **`info`** read-only property of the GPUAdapter interface returns a GPUAdapterInfo object containing identifying information about the adapter.
|
|
4269
|
+
*
|
|
4270
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/info)
|
|
4271
|
+
*/
|
|
4272
|
+
readonly info: GPUAdapterInfo;
|
|
4273
|
+
/**
|
|
4274
|
+
* The **`limits`** read-only property of the GPUAdapter interface returns a GPUSupportedLimits object that describes the limits supported by the adapter.
|
|
4275
|
+
*
|
|
4276
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/limits)
|
|
4277
|
+
*/
|
|
4278
|
+
readonly limits: GPUSupportedLimits;
|
|
4279
|
+
/**
|
|
4280
|
+
* The **`requestDevice()`** method of the GPUAdapter interface returns a Promise that fulfills with a GPUDevice object, which is the primary interface for communicating with the GPU.
|
|
4281
|
+
*
|
|
4282
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUAdapter/requestDevice)
|
|
4283
|
+
*/
|
|
4284
|
+
requestDevice(descriptor?: GPUDeviceDescriptor): Promise<GPUDevice>;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
declare var GPUAdapter: {
|
|
4288
|
+
prototype: GPUAdapter;
|
|
4289
|
+
new(): GPUAdapter;
|
|
4290
|
+
};
|
|
4291
|
+
|
|
4169
4292
|
/**
|
|
4170
4293
|
* The **`GPUAdapterInfo`** interface of the WebGPU API contains identifying information about a GPUAdapter.
|
|
4171
4294
|
* Available only in secure contexts.
|
|
@@ -4619,6 +4742,12 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
|
|
|
4619
4742
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroup)
|
|
4620
4743
|
*/
|
|
4621
4744
|
createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
|
|
4745
|
+
/**
|
|
4746
|
+
* The **`createBindGroupLayout()`** method of the GPUDevice interface creates a GPUBindGroupLayout that defines the structure and purpose of related GPU resources such as buffers that will be used in a pipeline, and is used as a template when creating GPUBindGroups.
|
|
4747
|
+
*
|
|
4748
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createBindGroupLayout)
|
|
4749
|
+
*/
|
|
4750
|
+
createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout;
|
|
4622
4751
|
/**
|
|
4623
4752
|
* The **`createBuffer()`** method of the GPUDevice interface creates a GPUBuffer in which to store raw data to use in GPU operations.
|
|
4624
4753
|
*
|
|
@@ -6388,6 +6517,15 @@ interface NavigatorConcurrentHardware {
|
|
|
6388
6517
|
readonly hardwareConcurrency: number;
|
|
6389
6518
|
}
|
|
6390
6519
|
|
|
6520
|
+
interface NavigatorGPU {
|
|
6521
|
+
/**
|
|
6522
|
+
* Available only in secure contexts.
|
|
6523
|
+
*
|
|
6524
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/gpu)
|
|
6525
|
+
*/
|
|
6526
|
+
readonly gpu: GPU;
|
|
6527
|
+
}
|
|
6528
|
+
|
|
6391
6529
|
interface NavigatorID {
|
|
6392
6530
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/appCodeName) */
|
|
6393
6531
|
readonly appCodeName: string;
|
|
@@ -11920,7 +12058,7 @@ declare var WorkerLocation: {
|
|
|
11920
12058
|
*
|
|
11921
12059
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerNavigator)
|
|
11922
12060
|
*/
|
|
11923
|
-
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
12061
|
+
interface WorkerNavigator extends NavigatorBadge, NavigatorConcurrentHardware, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
|
|
11924
12062
|
/**
|
|
11925
12063
|
* The read-only **`mediaCapabilities`** property of the WorkerNavigator interface references a MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities (as defined by the Media Capabilities API).
|
|
11926
12064
|
*
|
|
@@ -12889,6 +13027,7 @@ type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
|
|
|
12889
13027
|
type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
|
|
12890
13028
|
type GPUPipelineConstantValue = number;
|
|
12891
13029
|
type GPUSampleMask = number;
|
|
13030
|
+
type GPUShaderStageFlags = number;
|
|
12892
13031
|
type GPUSignedOffset32 = number;
|
|
12893
13032
|
type GPUSize32 = number;
|
|
12894
13033
|
type GPUSize32Out = number;
|
|
@@ -12944,6 +13083,7 @@ type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
|
|
|
12944
13083
|
type GPUAutoLayoutMode = "auto";
|
|
12945
13084
|
type GPUBlendFactor = "constant" | "dst" | "dst-alpha" | "one" | "one-minus-constant" | "one-minus-dst" | "one-minus-dst-alpha" | "one-minus-src" | "one-minus-src-alpha" | "src" | "src-alpha" | "src-alpha-saturated" | "zero";
|
|
12946
13085
|
type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
|
|
13086
|
+
type GPUBufferBindingType = "read-only-storage" | "storage" | "uniform";
|
|
12947
13087
|
type GPUBufferMapState = "mapped" | "pending" | "unmapped";
|
|
12948
13088
|
type GPUCanvasAlphaMode = "opaque" | "premultiplied";
|
|
12949
13089
|
type GPUCanvasToneMappingMode = "extended" | "standard";
|
|
@@ -12952,19 +13092,24 @@ type GPUCompilationMessageType = "error" | "info" | "warning";
|
|
|
12952
13092
|
type GPUCullMode = "back" | "front" | "none";
|
|
12953
13093
|
type GPUDeviceLostReason = "destroyed" | "unknown";
|
|
12954
13094
|
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
|
|
13095
|
+
type GPUFeatureName = "bgra8unorm-storage" | "clip-distances" | "core-features-and-limits" | "depth-clip-control" | "depth32float-stencil8" | "dual-source-blending" | "float32-blendable" | "float32-filterable" | "indirect-first-instance" | "primitive-index" | "rg11b10ufloat-renderable" | "shader-f16" | "subgroups" | "texture-compression-astc" | "texture-compression-astc-sliced-3d" | "texture-compression-bc" | "texture-compression-bc-sliced-3d" | "texture-compression-etc2" | "texture-formats-tier1" | "timestamp-query";
|
|
12955
13096
|
type GPUFilterMode = "linear" | "nearest";
|
|
12956
13097
|
type GPUFrontFace = "ccw" | "cw";
|
|
12957
13098
|
type GPUIndexFormat = "uint16" | "uint32";
|
|
12958
13099
|
type GPULoadOp = "clear" | "load";
|
|
12959
13100
|
type GPUMipmapFilterMode = "linear" | "nearest";
|
|
12960
13101
|
type GPUPipelineErrorReason = "internal" | "validation";
|
|
13102
|
+
type GPUPowerPreference = "high-performance" | "low-power";
|
|
12961
13103
|
type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
|
|
12962
13104
|
type GPUQueryType = "occlusion" | "timestamp";
|
|
13105
|
+
type GPUSamplerBindingType = "comparison" | "filtering" | "non-filtering";
|
|
12963
13106
|
type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
|
|
13107
|
+
type GPUStorageTextureAccess = "read-only" | "read-write" | "write-only";
|
|
12964
13108
|
type GPUStoreOp = "discard" | "store";
|
|
12965
13109
|
type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
|
|
12966
13110
|
type GPUTextureDimension = "1d" | "2d" | "3d";
|
|
12967
13111
|
type GPUTextureFormat = "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-snorm" | "bc4-r-unorm" | "bc5-rg-snorm" | "bc5-rg-unorm" | "bc6h-rgb-float" | "bc6h-rgb-ufloat" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "bgra8unorm" | "bgra8unorm-srgb" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "eac-r11snorm" | "eac-r11unorm" | "eac-rg11snorm" | "eac-rg11unorm" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "r16float" | "r16sint" | "r16snorm" | "r16uint" | "r16unorm" | "r32float" | "r32sint" | "r32uint" | "r8sint" | "r8snorm" | "r8uint" | "r8unorm" | "rg11b10ufloat" | "rg16float" | "rg16sint" | "rg16snorm" | "rg16uint" | "rg16unorm" | "rg32float" | "rg32sint" | "rg32uint" | "rg8sint" | "rg8snorm" | "rg8uint" | "rg8unorm" | "rgb10a2uint" | "rgb10a2unorm" | "rgb9e5ufloat" | "rgba16float" | "rgba16sint" | "rgba16snorm" | "rgba16uint" | "rgba16unorm" | "rgba32float" | "rgba32sint" | "rgba32uint" | "rgba8sint" | "rgba8snorm" | "rgba8uint" | "rgba8unorm" | "rgba8unorm-srgb" | "stencil8";
|
|
13112
|
+
type GPUTextureSampleType = "depth" | "float" | "sint" | "uint" | "unfilterable-float";
|
|
12968
13113
|
type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
|
|
12969
13114
|
type GPUVertexFormat = "float16" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "sint16" | "sint16x2" | "sint16x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "sint8" | "sint8x2" | "sint8x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "uint8" | "uint8x2" | "uint8x4" | "unorm10-10-10-2" | "unorm16" | "unorm16x2" | "unorm16x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "unorm8x4-bgra";
|
|
12970
13115
|
type GPUVertexStepMode = "instance" | "vertex";
|