@types/serviceworker 0.0.189 → 0.0.190

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 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.189 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.189.
31
+ You can read what changed in version 0.0.190 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.190.
package/index.d.ts CHANGED
@@ -285,6 +285,17 @@ interface GPUBindGroupEntry {
285
285
  resource: GPUBindingResource;
286
286
  }
287
287
 
288
+ interface GPUBlendComponent {
289
+ dstFactor?: GPUBlendFactor;
290
+ operation?: GPUBlendOperation;
291
+ srcFactor?: GPUBlendFactor;
292
+ }
293
+
294
+ interface GPUBlendState {
295
+ alpha: GPUBlendComponent;
296
+ color: GPUBlendComponent;
297
+ }
298
+
288
299
  interface GPUBufferBinding {
289
300
  buffer: GPUBuffer;
290
301
  offset?: GPUSize64;
@@ -318,6 +329,12 @@ interface GPUColorDict {
318
329
  r: number;
319
330
  }
320
331
 
332
+ interface GPUColorTargetState {
333
+ blend?: GPUBlendState;
334
+ format: GPUTextureFormat;
335
+ writeMask?: GPUColorWriteFlags;
336
+ }
337
+
321
338
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
322
339
  }
323
340
 
@@ -349,6 +366,19 @@ interface GPUCopyExternalImageSourceInfo {
349
366
  source: GPUCopyExternalImageSource;
350
367
  }
351
368
 
369
+ interface GPUDepthStencilState {
370
+ depthBias?: GPUDepthBias;
371
+ depthBiasClamp?: number;
372
+ depthBiasSlopeScale?: number;
373
+ depthCompare?: GPUCompareFunction;
374
+ depthWriteEnabled?: boolean;
375
+ format: GPUTextureFormat;
376
+ stencilBack?: GPUStencilFaceState;
377
+ stencilFront?: GPUStencilFaceState;
378
+ stencilReadMask?: GPUStencilValue;
379
+ stencilWriteMask?: GPUStencilValue;
380
+ }
381
+
352
382
  interface GPUExtent3DDict {
353
383
  depthOrArrayLayers?: GPUIntegerCoordinate;
354
384
  height?: GPUIntegerCoordinate;
@@ -359,6 +389,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
359
389
  colorSpace?: PredefinedColorSpace;
360
390
  }
361
391
 
392
+ interface GPUFragmentState extends GPUProgrammableStage {
393
+ targets: (GPUColorTargetState | null)[];
394
+ }
395
+
396
+ interface GPUMultisampleState {
397
+ alphaToCoverageEnabled?: boolean;
398
+ count?: GPUSize32;
399
+ mask?: GPUSampleMask;
400
+ }
401
+
362
402
  interface GPUObjectDescriptorBase {
363
403
  label?: string;
364
404
  }
@@ -386,6 +426,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
386
426
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
387
427
  }
388
428
 
429
+ interface GPUPrimitiveState {
430
+ cullMode?: GPUCullMode;
431
+ frontFace?: GPUFrontFace;
432
+ stripIndexFormat?: GPUIndexFormat;
433
+ topology?: GPUPrimitiveTopology;
434
+ unclippedDepth?: boolean;
435
+ }
436
+
389
437
  interface GPUProgrammableStage {
390
438
  constants?: Record<string, GPUPipelineConstantValue>;
391
439
  entryPoint?: string;
@@ -446,6 +494,14 @@ interface GPURenderPassTimestampWrites {
446
494
  querySet: GPUQuerySet;
447
495
  }
448
496
 
497
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
498
+ depthStencil?: GPUDepthStencilState;
499
+ fragment?: GPUFragmentState;
500
+ multisample?: GPUMultisampleState;
501
+ primitive?: GPUPrimitiveState;
502
+ vertex: GPUVertexState;
503
+ }
504
+
449
505
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
450
506
  addressModeU?: GPUAddressMode;
451
507
  addressModeV?: GPUAddressMode;
@@ -463,6 +519,13 @@ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
463
519
  code: string;
464
520
  }
465
521
 
522
+ interface GPUStencilFaceState {
523
+ compare?: GPUCompareFunction;
524
+ depthFailOp?: GPUStencilOperation;
525
+ failOp?: GPUStencilOperation;
526
+ passOp?: GPUStencilOperation;
527
+ }
528
+
466
529
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
467
530
  buffer: GPUBuffer;
468
531
  }
@@ -505,6 +568,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
505
568
  error: GPUError;
506
569
  }
507
570
 
571
+ interface GPUVertexAttribute {
572
+ format: GPUVertexFormat;
573
+ offset: GPUSize64;
574
+ shaderLocation: GPUIndex32;
575
+ }
576
+
577
+ interface GPUVertexBufferLayout {
578
+ arrayStride: GPUSize64;
579
+ attributes: GPUVertexAttribute[];
580
+ stepMode?: GPUVertexStepMode;
581
+ }
582
+
583
+ interface GPUVertexState extends GPUProgrammableStage {
584
+ buffers?: (GPUVertexBufferLayout | null)[];
585
+ }
586
+
508
587
  interface GetNotificationOptions {
509
588
  tag?: string;
510
589
  }
@@ -4902,6 +4981,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4902
4981
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4903
4982
  */
4904
4983
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4984
+ /**
4985
+ * The **`createRenderPipeline()`** method of the GPUDevice interface creates a GPURenderPipeline that can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder.
4986
+ *
4987
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4988
+ */
4989
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4990
+ /**
4991
+ * The **`createRenderPipelineAsync()`** method of the GPUDevice interface returns a Promise that fulfills with a GPURenderPipeline, which can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder, once the pipeline can be used without any stalling.
4992
+ *
4993
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4994
+ */
4995
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4905
4996
  /**
4906
4997
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4907
4998
  *
@@ -13112,7 +13203,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13112
13203
  type GPUBufferDynamicOffset = number;
13113
13204
  type GPUBufferUsageFlags = number;
13114
13205
  type GPUColor = number[] | GPUColorDict;
13206
+ type GPUColorWriteFlags = number;
13115
13207
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13208
+ type GPUDepthBias = number;
13116
13209
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13117
13210
  type GPUFlagsConstant = number;
13118
13211
  type GPUIndex32 = number;
@@ -13122,6 +13215,7 @@ type GPUMapModeFlags = number;
13122
13215
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13123
13216
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13124
13217
  type GPUPipelineConstantValue = number;
13218
+ type GPUSampleMask = number;
13125
13219
  type GPUSignedOffset32 = number;
13126
13220
  type GPUSize32 = number;
13127
13221
  type GPUSize32Out = number;
@@ -13179,24 +13273,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13179
13273
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13180
13274
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13181
13275
  type GPUAutoLayoutMode = "auto";
13276
+ 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";
13277
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13182
13278
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13183
13279
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13184
13280
  type GPUCanvasToneMappingMode = "extended" | "standard";
13185
13281
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13186
13282
  type GPUCompilationMessageType = "error" | "info" | "warning";
13283
+ type GPUCullMode = "back" | "front" | "none";
13187
13284
  type GPUDeviceLostReason = "destroyed" | "unknown";
13188
13285
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13189
13286
  type GPUFilterMode = "linear" | "nearest";
13287
+ type GPUFrontFace = "ccw" | "cw";
13190
13288
  type GPUIndexFormat = "uint16" | "uint32";
13191
13289
  type GPULoadOp = "clear" | "load";
13192
13290
  type GPUMipmapFilterMode = "linear" | "nearest";
13193
13291
  type GPUPipelineErrorReason = "internal" | "validation";
13292
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13194
13293
  type GPUQueryType = "occlusion" | "timestamp";
13294
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13195
13295
  type GPUStoreOp = "discard" | "store";
13196
13296
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13197
13297
  type GPUTextureDimension = "1d" | "2d" | "3d";
13198
13298
  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";
13199
13299
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13300
+ 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";
13301
+ type GPUVertexStepMode = "instance" | "vertex";
13200
13302
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13201
13303
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13202
13304
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/serviceworker",
3
- "version": "0.0.189",
3
+ "version": "0.0.190",
4
4
  "description": "Types for the global scope of Service Workers",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [],
package/ts5.5/index.d.ts CHANGED
@@ -282,6 +282,17 @@ interface GPUBindGroupEntry {
282
282
  resource: GPUBindingResource;
283
283
  }
284
284
 
285
+ interface GPUBlendComponent {
286
+ dstFactor?: GPUBlendFactor;
287
+ operation?: GPUBlendOperation;
288
+ srcFactor?: GPUBlendFactor;
289
+ }
290
+
291
+ interface GPUBlendState {
292
+ alpha: GPUBlendComponent;
293
+ color: GPUBlendComponent;
294
+ }
295
+
285
296
  interface GPUBufferBinding {
286
297
  buffer: GPUBuffer;
287
298
  offset?: GPUSize64;
@@ -315,6 +326,12 @@ interface GPUColorDict {
315
326
  r: number;
316
327
  }
317
328
 
329
+ interface GPUColorTargetState {
330
+ blend?: GPUBlendState;
331
+ format: GPUTextureFormat;
332
+ writeMask?: GPUColorWriteFlags;
333
+ }
334
+
318
335
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
319
336
  }
320
337
 
@@ -346,6 +363,19 @@ interface GPUCopyExternalImageSourceInfo {
346
363
  source: GPUCopyExternalImageSource;
347
364
  }
348
365
 
366
+ interface GPUDepthStencilState {
367
+ depthBias?: GPUDepthBias;
368
+ depthBiasClamp?: number;
369
+ depthBiasSlopeScale?: number;
370
+ depthCompare?: GPUCompareFunction;
371
+ depthWriteEnabled?: boolean;
372
+ format: GPUTextureFormat;
373
+ stencilBack?: GPUStencilFaceState;
374
+ stencilFront?: GPUStencilFaceState;
375
+ stencilReadMask?: GPUStencilValue;
376
+ stencilWriteMask?: GPUStencilValue;
377
+ }
378
+
349
379
  interface GPUExtent3DDict {
350
380
  depthOrArrayLayers?: GPUIntegerCoordinate;
351
381
  height?: GPUIntegerCoordinate;
@@ -356,6 +386,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
356
386
  colorSpace?: PredefinedColorSpace;
357
387
  }
358
388
 
389
+ interface GPUFragmentState extends GPUProgrammableStage {
390
+ targets: (GPUColorTargetState | null)[];
391
+ }
392
+
393
+ interface GPUMultisampleState {
394
+ alphaToCoverageEnabled?: boolean;
395
+ count?: GPUSize32;
396
+ mask?: GPUSampleMask;
397
+ }
398
+
359
399
  interface GPUObjectDescriptorBase {
360
400
  label?: string;
361
401
  }
@@ -383,6 +423,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
383
423
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
384
424
  }
385
425
 
426
+ interface GPUPrimitiveState {
427
+ cullMode?: GPUCullMode;
428
+ frontFace?: GPUFrontFace;
429
+ stripIndexFormat?: GPUIndexFormat;
430
+ topology?: GPUPrimitiveTopology;
431
+ unclippedDepth?: boolean;
432
+ }
433
+
386
434
  interface GPUProgrammableStage {
387
435
  constants?: Record<string, GPUPipelineConstantValue>;
388
436
  entryPoint?: string;
@@ -443,6 +491,14 @@ interface GPURenderPassTimestampWrites {
443
491
  querySet: GPUQuerySet;
444
492
  }
445
493
 
494
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
495
+ depthStencil?: GPUDepthStencilState;
496
+ fragment?: GPUFragmentState;
497
+ multisample?: GPUMultisampleState;
498
+ primitive?: GPUPrimitiveState;
499
+ vertex: GPUVertexState;
500
+ }
501
+
446
502
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
447
503
  addressModeU?: GPUAddressMode;
448
504
  addressModeV?: GPUAddressMode;
@@ -460,6 +516,13 @@ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
460
516
  code: string;
461
517
  }
462
518
 
519
+ interface GPUStencilFaceState {
520
+ compare?: GPUCompareFunction;
521
+ depthFailOp?: GPUStencilOperation;
522
+ failOp?: GPUStencilOperation;
523
+ passOp?: GPUStencilOperation;
524
+ }
525
+
463
526
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
464
527
  buffer: GPUBuffer;
465
528
  }
@@ -502,6 +565,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
502
565
  error: GPUError;
503
566
  }
504
567
 
568
+ interface GPUVertexAttribute {
569
+ format: GPUVertexFormat;
570
+ offset: GPUSize64;
571
+ shaderLocation: GPUIndex32;
572
+ }
573
+
574
+ interface GPUVertexBufferLayout {
575
+ arrayStride: GPUSize64;
576
+ attributes: GPUVertexAttribute[];
577
+ stepMode?: GPUVertexStepMode;
578
+ }
579
+
580
+ interface GPUVertexState extends GPUProgrammableStage {
581
+ buffers?: (GPUVertexBufferLayout | null)[];
582
+ }
583
+
505
584
  interface GetNotificationOptions {
506
585
  tag?: string;
507
586
  }
@@ -4899,6 +4978,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4899
4978
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4900
4979
  */
4901
4980
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4981
+ /**
4982
+ * The **`createRenderPipeline()`** method of the GPUDevice interface creates a GPURenderPipeline that can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder.
4983
+ *
4984
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4985
+ */
4986
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4987
+ /**
4988
+ * The **`createRenderPipelineAsync()`** method of the GPUDevice interface returns a Promise that fulfills with a GPURenderPipeline, which can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder, once the pipeline can be used without any stalling.
4989
+ *
4990
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4991
+ */
4992
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4902
4993
  /**
4903
4994
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4904
4995
  *
@@ -13109,7 +13200,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13109
13200
  type GPUBufferDynamicOffset = number;
13110
13201
  type GPUBufferUsageFlags = number;
13111
13202
  type GPUColor = number[] | GPUColorDict;
13203
+ type GPUColorWriteFlags = number;
13112
13204
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13205
+ type GPUDepthBias = number;
13113
13206
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13114
13207
  type GPUFlagsConstant = number;
13115
13208
  type GPUIndex32 = number;
@@ -13119,6 +13212,7 @@ type GPUMapModeFlags = number;
13119
13212
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13120
13213
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13121
13214
  type GPUPipelineConstantValue = number;
13215
+ type GPUSampleMask = number;
13122
13216
  type GPUSignedOffset32 = number;
13123
13217
  type GPUSize32 = number;
13124
13218
  type GPUSize32Out = number;
@@ -13176,24 +13270,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13176
13270
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13177
13271
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13178
13272
  type GPUAutoLayoutMode = "auto";
13273
+ 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";
13274
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13179
13275
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13180
13276
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13181
13277
  type GPUCanvasToneMappingMode = "extended" | "standard";
13182
13278
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13183
13279
  type GPUCompilationMessageType = "error" | "info" | "warning";
13280
+ type GPUCullMode = "back" | "front" | "none";
13184
13281
  type GPUDeviceLostReason = "destroyed" | "unknown";
13185
13282
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13186
13283
  type GPUFilterMode = "linear" | "nearest";
13284
+ type GPUFrontFace = "ccw" | "cw";
13187
13285
  type GPUIndexFormat = "uint16" | "uint32";
13188
13286
  type GPULoadOp = "clear" | "load";
13189
13287
  type GPUMipmapFilterMode = "linear" | "nearest";
13190
13288
  type GPUPipelineErrorReason = "internal" | "validation";
13289
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13191
13290
  type GPUQueryType = "occlusion" | "timestamp";
13291
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13192
13292
  type GPUStoreOp = "discard" | "store";
13193
13293
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13194
13294
  type GPUTextureDimension = "1d" | "2d" | "3d";
13195
13295
  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";
13196
13296
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13297
+ 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";
13298
+ type GPUVertexStepMode = "instance" | "vertex";
13197
13299
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13198
13300
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13199
13301
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
package/ts5.6/index.d.ts CHANGED
@@ -282,6 +282,17 @@ interface GPUBindGroupEntry {
282
282
  resource: GPUBindingResource;
283
283
  }
284
284
 
285
+ interface GPUBlendComponent {
286
+ dstFactor?: GPUBlendFactor;
287
+ operation?: GPUBlendOperation;
288
+ srcFactor?: GPUBlendFactor;
289
+ }
290
+
291
+ interface GPUBlendState {
292
+ alpha: GPUBlendComponent;
293
+ color: GPUBlendComponent;
294
+ }
295
+
285
296
  interface GPUBufferBinding {
286
297
  buffer: GPUBuffer;
287
298
  offset?: GPUSize64;
@@ -315,6 +326,12 @@ interface GPUColorDict {
315
326
  r: number;
316
327
  }
317
328
 
329
+ interface GPUColorTargetState {
330
+ blend?: GPUBlendState;
331
+ format: GPUTextureFormat;
332
+ writeMask?: GPUColorWriteFlags;
333
+ }
334
+
318
335
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
319
336
  }
320
337
 
@@ -346,6 +363,19 @@ interface GPUCopyExternalImageSourceInfo {
346
363
  source: GPUCopyExternalImageSource;
347
364
  }
348
365
 
366
+ interface GPUDepthStencilState {
367
+ depthBias?: GPUDepthBias;
368
+ depthBiasClamp?: number;
369
+ depthBiasSlopeScale?: number;
370
+ depthCompare?: GPUCompareFunction;
371
+ depthWriteEnabled?: boolean;
372
+ format: GPUTextureFormat;
373
+ stencilBack?: GPUStencilFaceState;
374
+ stencilFront?: GPUStencilFaceState;
375
+ stencilReadMask?: GPUStencilValue;
376
+ stencilWriteMask?: GPUStencilValue;
377
+ }
378
+
349
379
  interface GPUExtent3DDict {
350
380
  depthOrArrayLayers?: GPUIntegerCoordinate;
351
381
  height?: GPUIntegerCoordinate;
@@ -356,6 +386,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
356
386
  colorSpace?: PredefinedColorSpace;
357
387
  }
358
388
 
389
+ interface GPUFragmentState extends GPUProgrammableStage {
390
+ targets: (GPUColorTargetState | null)[];
391
+ }
392
+
393
+ interface GPUMultisampleState {
394
+ alphaToCoverageEnabled?: boolean;
395
+ count?: GPUSize32;
396
+ mask?: GPUSampleMask;
397
+ }
398
+
359
399
  interface GPUObjectDescriptorBase {
360
400
  label?: string;
361
401
  }
@@ -383,6 +423,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
383
423
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
384
424
  }
385
425
 
426
+ interface GPUPrimitiveState {
427
+ cullMode?: GPUCullMode;
428
+ frontFace?: GPUFrontFace;
429
+ stripIndexFormat?: GPUIndexFormat;
430
+ topology?: GPUPrimitiveTopology;
431
+ unclippedDepth?: boolean;
432
+ }
433
+
386
434
  interface GPUProgrammableStage {
387
435
  constants?: Record<string, GPUPipelineConstantValue>;
388
436
  entryPoint?: string;
@@ -443,6 +491,14 @@ interface GPURenderPassTimestampWrites {
443
491
  querySet: GPUQuerySet;
444
492
  }
445
493
 
494
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
495
+ depthStencil?: GPUDepthStencilState;
496
+ fragment?: GPUFragmentState;
497
+ multisample?: GPUMultisampleState;
498
+ primitive?: GPUPrimitiveState;
499
+ vertex: GPUVertexState;
500
+ }
501
+
446
502
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
447
503
  addressModeU?: GPUAddressMode;
448
504
  addressModeV?: GPUAddressMode;
@@ -460,6 +516,13 @@ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
460
516
  code: string;
461
517
  }
462
518
 
519
+ interface GPUStencilFaceState {
520
+ compare?: GPUCompareFunction;
521
+ depthFailOp?: GPUStencilOperation;
522
+ failOp?: GPUStencilOperation;
523
+ passOp?: GPUStencilOperation;
524
+ }
525
+
463
526
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
464
527
  buffer: GPUBuffer;
465
528
  }
@@ -502,6 +565,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
502
565
  error: GPUError;
503
566
  }
504
567
 
568
+ interface GPUVertexAttribute {
569
+ format: GPUVertexFormat;
570
+ offset: GPUSize64;
571
+ shaderLocation: GPUIndex32;
572
+ }
573
+
574
+ interface GPUVertexBufferLayout {
575
+ arrayStride: GPUSize64;
576
+ attributes: GPUVertexAttribute[];
577
+ stepMode?: GPUVertexStepMode;
578
+ }
579
+
580
+ interface GPUVertexState extends GPUProgrammableStage {
581
+ buffers?: (GPUVertexBufferLayout | null)[];
582
+ }
583
+
505
584
  interface GetNotificationOptions {
506
585
  tag?: string;
507
586
  }
@@ -4899,6 +4978,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4899
4978
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4900
4979
  */
4901
4980
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4981
+ /**
4982
+ * The **`createRenderPipeline()`** method of the GPUDevice interface creates a GPURenderPipeline that can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder.
4983
+ *
4984
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4985
+ */
4986
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4987
+ /**
4988
+ * The **`createRenderPipelineAsync()`** method of the GPUDevice interface returns a Promise that fulfills with a GPURenderPipeline, which can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder, once the pipeline can be used without any stalling.
4989
+ *
4990
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4991
+ */
4992
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4902
4993
  /**
4903
4994
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4904
4995
  *
@@ -13109,7 +13200,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13109
13200
  type GPUBufferDynamicOffset = number;
13110
13201
  type GPUBufferUsageFlags = number;
13111
13202
  type GPUColor = number[] | GPUColorDict;
13203
+ type GPUColorWriteFlags = number;
13112
13204
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13205
+ type GPUDepthBias = number;
13113
13206
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13114
13207
  type GPUFlagsConstant = number;
13115
13208
  type GPUIndex32 = number;
@@ -13119,6 +13212,7 @@ type GPUMapModeFlags = number;
13119
13212
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13120
13213
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13121
13214
  type GPUPipelineConstantValue = number;
13215
+ type GPUSampleMask = number;
13122
13216
  type GPUSignedOffset32 = number;
13123
13217
  type GPUSize32 = number;
13124
13218
  type GPUSize32Out = number;
@@ -13176,24 +13270,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13176
13270
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13177
13271
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13178
13272
  type GPUAutoLayoutMode = "auto";
13273
+ 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";
13274
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13179
13275
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13180
13276
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13181
13277
  type GPUCanvasToneMappingMode = "extended" | "standard";
13182
13278
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13183
13279
  type GPUCompilationMessageType = "error" | "info" | "warning";
13280
+ type GPUCullMode = "back" | "front" | "none";
13184
13281
  type GPUDeviceLostReason = "destroyed" | "unknown";
13185
13282
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13186
13283
  type GPUFilterMode = "linear" | "nearest";
13284
+ type GPUFrontFace = "ccw" | "cw";
13187
13285
  type GPUIndexFormat = "uint16" | "uint32";
13188
13286
  type GPULoadOp = "clear" | "load";
13189
13287
  type GPUMipmapFilterMode = "linear" | "nearest";
13190
13288
  type GPUPipelineErrorReason = "internal" | "validation";
13289
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13191
13290
  type GPUQueryType = "occlusion" | "timestamp";
13291
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13192
13292
  type GPUStoreOp = "discard" | "store";
13193
13293
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13194
13294
  type GPUTextureDimension = "1d" | "2d" | "3d";
13195
13295
  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";
13196
13296
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13297
+ 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";
13298
+ type GPUVertexStepMode = "instance" | "vertex";
13197
13299
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13198
13300
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13199
13301
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
package/ts5.9/index.d.ts CHANGED
@@ -282,6 +282,17 @@ interface GPUBindGroupEntry {
282
282
  resource: GPUBindingResource;
283
283
  }
284
284
 
285
+ interface GPUBlendComponent {
286
+ dstFactor?: GPUBlendFactor;
287
+ operation?: GPUBlendOperation;
288
+ srcFactor?: GPUBlendFactor;
289
+ }
290
+
291
+ interface GPUBlendState {
292
+ alpha: GPUBlendComponent;
293
+ color: GPUBlendComponent;
294
+ }
295
+
285
296
  interface GPUBufferBinding {
286
297
  buffer: GPUBuffer;
287
298
  offset?: GPUSize64;
@@ -315,6 +326,12 @@ interface GPUColorDict {
315
326
  r: number;
316
327
  }
317
328
 
329
+ interface GPUColorTargetState {
330
+ blend?: GPUBlendState;
331
+ format: GPUTextureFormat;
332
+ writeMask?: GPUColorWriteFlags;
333
+ }
334
+
318
335
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
319
336
  }
320
337
 
@@ -346,6 +363,19 @@ interface GPUCopyExternalImageSourceInfo {
346
363
  source: GPUCopyExternalImageSource;
347
364
  }
348
365
 
366
+ interface GPUDepthStencilState {
367
+ depthBias?: GPUDepthBias;
368
+ depthBiasClamp?: number;
369
+ depthBiasSlopeScale?: number;
370
+ depthCompare?: GPUCompareFunction;
371
+ depthWriteEnabled?: boolean;
372
+ format: GPUTextureFormat;
373
+ stencilBack?: GPUStencilFaceState;
374
+ stencilFront?: GPUStencilFaceState;
375
+ stencilReadMask?: GPUStencilValue;
376
+ stencilWriteMask?: GPUStencilValue;
377
+ }
378
+
349
379
  interface GPUExtent3DDict {
350
380
  depthOrArrayLayers?: GPUIntegerCoordinate;
351
381
  height?: GPUIntegerCoordinate;
@@ -356,6 +386,16 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
356
386
  colorSpace?: PredefinedColorSpace;
357
387
  }
358
388
 
389
+ interface GPUFragmentState extends GPUProgrammableStage {
390
+ targets: (GPUColorTargetState | null)[];
391
+ }
392
+
393
+ interface GPUMultisampleState {
394
+ alphaToCoverageEnabled?: boolean;
395
+ count?: GPUSize32;
396
+ mask?: GPUSampleMask;
397
+ }
398
+
359
399
  interface GPUObjectDescriptorBase {
360
400
  label?: string;
361
401
  }
@@ -383,6 +423,14 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
383
423
  bindGroupLayouts: (GPUBindGroupLayout | null)[];
384
424
  }
385
425
 
426
+ interface GPUPrimitiveState {
427
+ cullMode?: GPUCullMode;
428
+ frontFace?: GPUFrontFace;
429
+ stripIndexFormat?: GPUIndexFormat;
430
+ topology?: GPUPrimitiveTopology;
431
+ unclippedDepth?: boolean;
432
+ }
433
+
386
434
  interface GPUProgrammableStage {
387
435
  constants?: Record<string, GPUPipelineConstantValue>;
388
436
  entryPoint?: string;
@@ -443,6 +491,14 @@ interface GPURenderPassTimestampWrites {
443
491
  querySet: GPUQuerySet;
444
492
  }
445
493
 
494
+ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
495
+ depthStencil?: GPUDepthStencilState;
496
+ fragment?: GPUFragmentState;
497
+ multisample?: GPUMultisampleState;
498
+ primitive?: GPUPrimitiveState;
499
+ vertex: GPUVertexState;
500
+ }
501
+
446
502
  interface GPUSamplerDescriptor extends GPUObjectDescriptorBase {
447
503
  addressModeU?: GPUAddressMode;
448
504
  addressModeV?: GPUAddressMode;
@@ -460,6 +516,13 @@ interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
460
516
  code: string;
461
517
  }
462
518
 
519
+ interface GPUStencilFaceState {
520
+ compare?: GPUCompareFunction;
521
+ depthFailOp?: GPUStencilOperation;
522
+ failOp?: GPUStencilOperation;
523
+ passOp?: GPUStencilOperation;
524
+ }
525
+
463
526
  interface GPUTexelCopyBufferInfo extends GPUTexelCopyBufferLayout {
464
527
  buffer: GPUBuffer;
465
528
  }
@@ -502,6 +565,22 @@ interface GPUUncapturedErrorEventInit extends EventInit {
502
565
  error: GPUError;
503
566
  }
504
567
 
568
+ interface GPUVertexAttribute {
569
+ format: GPUVertexFormat;
570
+ offset: GPUSize64;
571
+ shaderLocation: GPUIndex32;
572
+ }
573
+
574
+ interface GPUVertexBufferLayout {
575
+ arrayStride: GPUSize64;
576
+ attributes: GPUVertexAttribute[];
577
+ stepMode?: GPUVertexStepMode;
578
+ }
579
+
580
+ interface GPUVertexState extends GPUProgrammableStage {
581
+ buffers?: (GPUVertexBufferLayout | null)[];
582
+ }
583
+
505
584
  interface GetNotificationOptions {
506
585
  tag?: string;
507
586
  }
@@ -4899,6 +4978,18 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
4899
4978
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderBundleEncoder)
4900
4979
  */
4901
4980
  createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder;
4981
+ /**
4982
+ * The **`createRenderPipeline()`** method of the GPUDevice interface creates a GPURenderPipeline that can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder.
4983
+ *
4984
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipeline)
4985
+ */
4986
+ createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline;
4987
+ /**
4988
+ * The **`createRenderPipelineAsync()`** method of the GPUDevice interface returns a Promise that fulfills with a GPURenderPipeline, which can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder, once the pipeline can be used without any stalling.
4989
+ *
4990
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/createRenderPipelineAsync)
4991
+ */
4992
+ createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise<GPURenderPipeline>;
4902
4993
  /**
4903
4994
  * The **`createSampler()`** method of the GPUDevice interface creates a GPUSampler, which controls how shaders transform and filter texture resource data.
4904
4995
  *
@@ -13109,7 +13200,9 @@ type GPUBindingResource = GPUSampler | GPUTexture | GPUTextureView | GPUBuffer |
13109
13200
  type GPUBufferDynamicOffset = number;
13110
13201
  type GPUBufferUsageFlags = number;
13111
13202
  type GPUColor = number[] | GPUColorDict;
13203
+ type GPUColorWriteFlags = number;
13112
13204
  type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
13205
+ type GPUDepthBias = number;
13113
13206
  type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
13114
13207
  type GPUFlagsConstant = number;
13115
13208
  type GPUIndex32 = number;
@@ -13119,6 +13212,7 @@ type GPUMapModeFlags = number;
13119
13212
  type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
13120
13213
  type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
13121
13214
  type GPUPipelineConstantValue = number;
13215
+ type GPUSampleMask = number;
13122
13216
  type GPUSignedOffset32 = number;
13123
13217
  type GPUSize32 = number;
13124
13218
  type GPUSize32Out = number;
@@ -13176,24 +13270,32 @@ type FontFaceSetLoadStatus = "loaded" | "loading";
13176
13270
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
13177
13271
  type GPUAddressMode = "clamp-to-edge" | "mirror-repeat" | "repeat";
13178
13272
  type GPUAutoLayoutMode = "auto";
13273
+ 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";
13274
+ type GPUBlendOperation = "add" | "max" | "min" | "reverse-subtract" | "subtract";
13179
13275
  type GPUBufferMapState = "mapped" | "pending" | "unmapped";
13180
13276
  type GPUCanvasAlphaMode = "opaque" | "premultiplied";
13181
13277
  type GPUCanvasToneMappingMode = "extended" | "standard";
13182
13278
  type GPUCompareFunction = "always" | "equal" | "greater" | "greater-equal" | "less" | "less-equal" | "never" | "not-equal";
13183
13279
  type GPUCompilationMessageType = "error" | "info" | "warning";
13280
+ type GPUCullMode = "back" | "front" | "none";
13184
13281
  type GPUDeviceLostReason = "destroyed" | "unknown";
13185
13282
  type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
13186
13283
  type GPUFilterMode = "linear" | "nearest";
13284
+ type GPUFrontFace = "ccw" | "cw";
13187
13285
  type GPUIndexFormat = "uint16" | "uint32";
13188
13286
  type GPULoadOp = "clear" | "load";
13189
13287
  type GPUMipmapFilterMode = "linear" | "nearest";
13190
13288
  type GPUPipelineErrorReason = "internal" | "validation";
13289
+ type GPUPrimitiveTopology = "line-list" | "line-strip" | "point-list" | "triangle-list" | "triangle-strip";
13191
13290
  type GPUQueryType = "occlusion" | "timestamp";
13291
+ type GPUStencilOperation = "decrement-clamp" | "decrement-wrap" | "increment-clamp" | "increment-wrap" | "invert" | "keep" | "replace" | "zero";
13192
13292
  type GPUStoreOp = "discard" | "store";
13193
13293
  type GPUTextureAspect = "all" | "depth-only" | "stencil-only";
13194
13294
  type GPUTextureDimension = "1d" | "2d" | "3d";
13195
13295
  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";
13196
13296
  type GPUTextureViewDimension = "1d" | "2d" | "2d-array" | "3d" | "cube" | "cube-array";
13297
+ 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";
13298
+ type GPUVertexStepMode = "instance" | "vertex";
13197
13299
  type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
13198
13300
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
13199
13301
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";