Skip to content

Commit f8d7680

Browse files
committed
Roll generator fixes for Iterable and nullables (no dist changes)
This just makes `generated` match more closely with `dist`. There are no changes in `dist`. (Oops, the README got ahead. It's in sync now!)
1 parent 152a2be commit f8d7680

2 files changed

Lines changed: 55 additions & 24 deletions

File tree

generated/index.d.ts

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type GPUBufferUsageFlags =
1010
number;
1111
type GPUColor =
1212

13-
| Array<number>
13+
| Iterable<number>
1414
| GPUColorDict;
1515
type GPUColorWriteFlags =
1616
number;
@@ -27,7 +27,7 @@ type GPUDepthBias =
2727
number;
2828
type GPUExtent3D =
2929

30-
| Array<GPUIntegerCoordinate>
30+
| Iterable<GPUIntegerCoordinate>
3131
| GPUExtent3DDict;
3232
type GPUFlagsConstant =
3333
number;
@@ -41,11 +41,11 @@ type GPUMapModeFlags =
4141
number;
4242
type GPUOrigin2D =
4343

44-
| Array<GPUIntegerCoordinate>
44+
| Iterable<GPUIntegerCoordinate>
4545
| GPUOrigin2DDict;
4646
type GPUOrigin3D =
4747

48-
| Array<GPUIntegerCoordinate>
48+
| Iterable<GPUIntegerCoordinate>
4949
| GPUOrigin3DDict;
5050
type GPUPipelineConstantValue =
5151
number;
@@ -409,7 +409,7 @@ interface GPUBindGroupDescriptor
409409
* A list of entries describing the resources to expose to the shader for each binding
410410
* described by the {@link GPUBindGroupDescriptor#layout}.
411411
*/
412-
entries: Array<GPUBindGroupEntry>;
412+
entries: Iterable<GPUBindGroupEntry>;
413413
}
414414

415415
interface GPUBindGroupEntry {
@@ -431,7 +431,7 @@ interface GPUBindGroupLayoutDescriptor
431431
/**
432432
* A list of entries describing the shader resource bindings for a bind group.
433433
*/
434-
entries: Array<GPUBindGroupLayoutEntry>;
434+
entries: Iterable<GPUBindGroupLayoutEntry>;
435435
}
436436

437437
interface GPUBindGroupLayoutEntry {
@@ -594,7 +594,7 @@ interface GPUCanvasConfiguration {
594594
* The formats that views created from textures returned by
595595
* {@link GPUCanvasContext#getCurrentTexture} may use.
596596
*/
597-
viewFormats?: Array<GPUTextureFormat>;
597+
viewFormats?: Iterable<GPUTextureFormat>;
598598
/**
599599
* The color space that values written into textures returned by
600600
* {@link GPUCanvasContext#getCurrentTexture} should be displayed with.
@@ -796,7 +796,7 @@ interface GPUDeviceDescriptor
796796
* Exactly the specified set of features, and no more or less, will be allowed in validation
797797
* of API calls on the resulting device.
798798
*/
799-
requiredFeatures?: Array<GPUFeatureName>;
799+
requiredFeatures?: Iterable<GPUFeatureName>;
800800
/**
801801
* Specifies the limits that are required by the device request.
802802
* The request will fail if the adapter cannot provide these limits.
@@ -861,7 +861,11 @@ interface GPUFragmentState
861861
* A list of {@link GPUColorTargetState} defining the formats and behaviors of the color targets
862862
* this pipeline writes to.
863863
*/
864-
targets: Array<GPUColorTargetState | null>;
864+
targets: Iterable<
865+
| GPUColorTargetState
866+
| null
867+
| undefined
868+
>;
865869
}
866870

867871
interface GPUMultisampleState {
@@ -925,7 +929,11 @@ interface GPUPipelineLayoutDescriptor
925929
* to a @group attribute in the {@link GPUShaderModule}, with the `N`th element corresponding
926930
* with `@group(N)`.
927931
*/
928-
bindGroupLayouts: Array<GPUBindGroupLayout | null>;
932+
bindGroupLayouts: Iterable<
933+
| GPUBindGroupLayout
934+
| null
935+
| undefined
936+
>;
929937
}
930938

931939
interface GPUPrimitiveState {
@@ -1178,7 +1186,11 @@ interface GPURenderPassDescriptor
11781186
* Due to compatible usage list|usage compatibility, no color attachment
11791187
* may alias another attachment or any resource used inside the render pass.
11801188
*/
1181-
colorAttachments: Array<GPURenderPassColorAttachment | null>;
1189+
colorAttachments: Iterable<
1190+
| GPURenderPassColorAttachment
1191+
| null
1192+
| undefined
1193+
>;
11821194
/**
11831195
* The {@link GPURenderPassDepthStencilAttachment} value that defines the depth/stencil
11841196
* attachment that will be output to and tested against when executing this render pass.
@@ -1207,7 +1219,11 @@ interface GPURenderPassLayout
12071219
/**
12081220
* A list of the {@link GPUTextureFormat}s of the color attachments for this pass or bundle.
12091221
*/
1210-
colorFormats: Array<GPUTextureFormat | null>;
1222+
colorFormats: Iterable<
1223+
| GPUTextureFormat
1224+
| null
1225+
| undefined
1226+
>;
12111227
/**
12121228
* The {@link GPUTextureFormat} of the depth/stencil attachment for this pass or bundle.
12131229
*/
@@ -1389,7 +1405,7 @@ interface GPUShaderModuleDescriptor
13891405
* errors (like unknown entry point names or incompatible pipeline layouts) to developers,
13901406
* for example in the browser developer console.
13911407
*/
1392-
compilationHints?: Array<GPUShaderModuleCompilationHint>;
1408+
compilationHints?: Iterable<GPUShaderModuleCompilationHint>;
13931409
}
13941410

13951411
interface GPUStencilFaceState {
@@ -1549,7 +1565,7 @@ interface GPUTextureDescriptor
15491565
* - `format` and `viewFormat` differ only in whether they are `srgb` formats (have the `-srgb` suffix).
15501566
* </div>
15511567
*/
1552-
viewFormats?: Array<GPUTextureFormat>;
1568+
viewFormats?: Iterable<GPUTextureFormat>;
15531569
}
15541570

15551571
interface GPUTextureViewDescriptor
@@ -1630,7 +1646,7 @@ interface GPUVertexBufferLayout {
16301646
/**
16311647
* An array defining the layout of the vertex attributes within each element.
16321648
*/
1633-
attributes: Array<GPUVertexAttribute>;
1649+
attributes: Iterable<GPUVertexAttribute>;
16341650
}
16351651

16361652
interface GPUVertexState
@@ -1639,7 +1655,11 @@ interface GPUVertexState
16391655
* A list of {@link GPUVertexBufferLayout}s, each defining the layout of vertex attribute data in a
16401656
* vertex buffer used by this pipeline.
16411657
*/
1642-
buffers?: Array<GPUVertexBufferLayout | null>;
1658+
buffers?: Iterable<
1659+
| GPUVertexBufferLayout
1660+
| null
1661+
| undefined
1662+
>;
16431663
}
16441664

16451665
interface GPUBindingCommandsMixin {
@@ -1648,12 +1668,18 @@ interface GPUBindingCommandsMixin {
16481668
*/
16491669
setBindGroup(
16501670
index: GPUIndex32,
1651-
bindGroup: GPUBindGroup | null,
1652-
dynamicOffsets?: Array<GPUBufferDynamicOffset>
1671+
bindGroup:
1672+
| GPUBindGroup
1673+
| null
1674+
| undefined,
1675+
dynamicOffsets?: Iterable<GPUBufferDynamicOffset>
16531676
): undefined;
16541677
setBindGroup(
16551678
index: GPUIndex32,
1656-
bindGroup: GPUBindGroup | null,
1679+
bindGroup:
1680+
| GPUBindGroup
1681+
| null
1682+
| undefined,
16571683
dynamicOffsetsData: Uint32Array,
16581684
dynamicOffsetsDataStart: GPUSize64,
16591685
dynamicOffsetsDataLength: GPUSize32
@@ -1731,7 +1757,10 @@ interface GPURenderCommandsMixin {
17311757
*/
17321758
setVertexBuffer(
17331759
slot: GPUIndex32,
1734-
buffer: GPUBuffer | null,
1760+
buffer:
1761+
| GPUBuffer
1762+
| null
1763+
| undefined,
17351764
offset?: GPUSize64,
17361765
size?: GPUSize64
17371766
): undefined;
@@ -2404,7 +2433,9 @@ interface GPUPipelineError
24042433
declare var GPUPipelineError: {
24052434
prototype: GPUPipelineError;
24062435
new (
2407-
message?: string,
2436+
message:
2437+
| string
2438+
| undefined,
24082439
options: GPUPipelineErrorInit
24092440
): GPUPipelineError;
24102441
};
@@ -2447,7 +2478,7 @@ interface GPUQueue
24472478
* `commandBuffers`:
24482479
*/
24492480
submit(
2450-
commandBuffers: Array<GPUCommandBuffer>
2481+
commandBuffers: Iterable<GPUCommandBuffer>
24512482
): undefined;
24522483
onSubmittedWorkDone(): Promise<undefined>;
24532484
/**
@@ -2617,7 +2648,7 @@ interface GPURenderPassEncoder
26172648
* @param bundles - List of render bundles to execute.
26182649
*/
26192650
executeBundles(
2620-
bundles: Array<GPURenderBundle>
2651+
bundles: Iterable<GPURenderBundle>
26212652
): undefined;
26222653
/**
26232654
* Completes recording of the render pass commands sequence.

third_party/bikeshed-to-ts

0 commit comments

Comments
 (0)