Skip to content

Commit 06cc7ee

Browse files
authored
Add GPUQueue (#2402)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent 7ea7b55 commit 06cc7ee

29 files changed

+1760
-3
lines changed

baselines/dom.generated.d.ts

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,17 +812,58 @@ interface GPUColorDict {
812812
r: number;
813813
}
814814

815+
interface GPUCopyExternalImageDestInfo extends GPUTexelCopyTextureInfo {
816+
colorSpace?: PredefinedColorSpace;
817+
premultipliedAlpha?: boolean;
818+
}
819+
820+
interface GPUCopyExternalImageSourceInfo {
821+
flipY?: boolean;
822+
origin?: GPUOrigin2D;
823+
source: GPUCopyExternalImageSource;
824+
}
825+
826+
interface GPUExtent3DDict {
827+
depthOrArrayLayers?: GPUIntegerCoordinate;
828+
height?: GPUIntegerCoordinate;
829+
width: GPUIntegerCoordinate;
830+
}
831+
815832
interface GPUObjectDescriptorBase {
816833
label?: string;
817834
}
818835

836+
interface GPUOrigin2DDict {
837+
x?: GPUIntegerCoordinate;
838+
y?: GPUIntegerCoordinate;
839+
}
840+
841+
interface GPUOrigin3DDict {
842+
x?: GPUIntegerCoordinate;
843+
y?: GPUIntegerCoordinate;
844+
z?: GPUIntegerCoordinate;
845+
}
846+
819847
interface GPUPipelineErrorInit {
820848
reason: GPUPipelineErrorReason;
821849
}
822850

823851
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
824852
}
825853

854+
interface GPUTexelCopyBufferLayout {
855+
bytesPerRow?: GPUSize32;
856+
offset?: GPUSize64;
857+
rowsPerImage?: GPUSize32;
858+
}
859+
860+
interface GPUTexelCopyTextureInfo {
861+
aspect?: GPUTextureAspect;
862+
mipLevel?: GPUIntegerCoordinate;
863+
origin?: GPUOrigin3D;
864+
texture: GPUTexture;
865+
}
866+
826867
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
827868
arrayLayerCount?: GPUIntegerCoordinate;
828869
aspect?: GPUTextureAspect;
@@ -15219,6 +15260,50 @@ declare var GPUQuerySet: {
1521915260
new(): GPUQuerySet;
1522015261
};
1522115262

15263+
/**
15264+
* The **`GPUQueue`** interface of the WebGPU API controls execution of encoded commands on the GPU.
15265+
* Available only in secure contexts.
15266+
*
15267+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue)
15268+
*/
15269+
interface GPUQueue extends GPUObjectBase {
15270+
/**
15271+
* The **`copyExternalImageToTexture()`** method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.
15272+
*
15273+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/copyExternalImageToTexture)
15274+
*/
15275+
copyExternalImageToTexture(source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: GPUExtent3D): void;
15276+
/**
15277+
* The **`onSubmittedWorkDone()`** method of the GPUQueue interface returns a Promise that resolves when all the work submitted to the GPU via this GPUQueue at the point the method is called has been processed.
15278+
*
15279+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/onSubmittedWorkDone)
15280+
*/
15281+
onSubmittedWorkDone(): Promise<void>;
15282+
/**
15283+
* The **`submit()`** method of the GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU.
15284+
*
15285+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/submit)
15286+
*/
15287+
submit(commandBuffers: GPUCommandBuffer[]): void;
15288+
/**
15289+
* The **`writeBuffer()`** method of the GPUQueue interface writes a provided data source into a given GPUBuffer.
15290+
*
15291+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeBuffer)
15292+
*/
15293+
writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: AllowSharedBufferSource, dataOffset?: GPUSize64, size?: GPUSize64): void;
15294+
/**
15295+
* The **`writeTexture()`** method of the GPUQueue interface writes a provided data source into a given GPUTexture.
15296+
*
15297+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeTexture)
15298+
*/
15299+
writeTexture(destination: GPUTexelCopyTextureInfo, data: AllowSharedBufferSource, dataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D): void;
15300+
}
15301+
15302+
declare var GPUQueue: {
15303+
prototype: GPUQueue;
15304+
new(): GPUQueue;
15305+
};
15306+
1522215307
/**
1522315308
* The **`GPURenderBundle`** interface of the WebGPU API represents a container for pre-recorded bundles of commands.
1522415309
* Available only in secure contexts.
@@ -43412,11 +43497,15 @@ type GLuint = number;
4341243497
type GLuint64 = number;
4341343498
type GPUBufferDynamicOffset = number;
4341443499
type GPUColor = number[] | GPUColorDict;
43500+
type GPUCopyExternalImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas;
43501+
type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
4341543502
type GPUFlagsConstant = number;
4341643503
type GPUIndex32 = number;
4341743504
type GPUIntegerCoordinate = number;
4341843505
type GPUIntegerCoordinateOut = number;
4341943506
type GPUMapModeFlags = number;
43507+
type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
43508+
type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
4342043509
type GPUSignedOffset32 = number;
4342143510
type GPUSize32 = number;
4342243511
type GPUSize32Out = number;
@@ -43829,6 +43918,27 @@ interface GPUBindingCommandsMixin {
4382943918
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: Iterable<GPUBufferDynamicOffset>): void;
4383043919
}
4383143920

43921+
interface GPUQueue {
43922+
/**
43923+
* The **`copyExternalImageToTexture()`** method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.
43924+
*
43925+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/copyExternalImageToTexture)
43926+
*/
43927+
copyExternalImageToTexture(source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
43928+
/**
43929+
* The **`submit()`** method of the GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU.
43930+
*
43931+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/submit)
43932+
*/
43933+
submit(commandBuffers: Iterable<GPUCommandBuffer>): void;
43934+
/**
43935+
* The **`writeTexture()`** method of the GPUQueue interface writes a provided data source into a given GPUTexture.
43936+
*
43937+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeTexture)
43938+
*/
43939+
writeTexture(destination: GPUTexelCopyTextureInfo, data: AllowSharedBufferSource, dataLayout: GPUTexelCopyBufferLayout, size: Iterable<GPUIntegerCoordinate>): void;
43940+
}
43941+
4383243942
interface GPURenderPassEncoder {
4383343943
/**
4383443944
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.

baselines/serviceworker.generated.d.ts

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,58 @@ interface GPUColorDict {
279279
r: number;
280280
}
281281

282+
interface GPUCopyExternalImageDestInfo extends GPUTexelCopyTextureInfo {
283+
colorSpace?: PredefinedColorSpace;
284+
premultipliedAlpha?: boolean;
285+
}
286+
287+
interface GPUCopyExternalImageSourceInfo {
288+
flipY?: boolean;
289+
origin?: GPUOrigin2D;
290+
source: GPUCopyExternalImageSource;
291+
}
292+
293+
interface GPUExtent3DDict {
294+
depthOrArrayLayers?: GPUIntegerCoordinate;
295+
height?: GPUIntegerCoordinate;
296+
width: GPUIntegerCoordinate;
297+
}
298+
282299
interface GPUObjectDescriptorBase {
283300
label?: string;
284301
}
285302

303+
interface GPUOrigin2DDict {
304+
x?: GPUIntegerCoordinate;
305+
y?: GPUIntegerCoordinate;
306+
}
307+
308+
interface GPUOrigin3DDict {
309+
x?: GPUIntegerCoordinate;
310+
y?: GPUIntegerCoordinate;
311+
z?: GPUIntegerCoordinate;
312+
}
313+
286314
interface GPUPipelineErrorInit {
287315
reason: GPUPipelineErrorReason;
288316
}
289317

290318
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {
291319
}
292320

321+
interface GPUTexelCopyBufferLayout {
322+
bytesPerRow?: GPUSize32;
323+
offset?: GPUSize64;
324+
rowsPerImage?: GPUSize32;
325+
}
326+
327+
interface GPUTexelCopyTextureInfo {
328+
aspect?: GPUTextureAspect;
329+
mipLevel?: GPUIntegerCoordinate;
330+
origin?: GPUOrigin3D;
331+
texture: GPUTexture;
332+
}
333+
293334
interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase {
294335
arrayLayerCount?: GPUIntegerCoordinate;
295336
aspect?: GPUTextureAspect;
@@ -4662,6 +4703,50 @@ declare var GPUQuerySet: {
46624703
new(): GPUQuerySet;
46634704
};
46644705

4706+
/**
4707+
* The **`GPUQueue`** interface of the WebGPU API controls execution of encoded commands on the GPU.
4708+
* Available only in secure contexts.
4709+
*
4710+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue)
4711+
*/
4712+
interface GPUQueue extends GPUObjectBase {
4713+
/**
4714+
* The **`copyExternalImageToTexture()`** method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.
4715+
*
4716+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/copyExternalImageToTexture)
4717+
*/
4718+
copyExternalImageToTexture(source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: GPUExtent3D): void;
4719+
/**
4720+
* The **`onSubmittedWorkDone()`** method of the GPUQueue interface returns a Promise that resolves when all the work submitted to the GPU via this GPUQueue at the point the method is called has been processed.
4721+
*
4722+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/onSubmittedWorkDone)
4723+
*/
4724+
onSubmittedWorkDone(): Promise<void>;
4725+
/**
4726+
* The **`submit()`** method of the GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU.
4727+
*
4728+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/submit)
4729+
*/
4730+
submit(commandBuffers: GPUCommandBuffer[]): void;
4731+
/**
4732+
* The **`writeBuffer()`** method of the GPUQueue interface writes a provided data source into a given GPUBuffer.
4733+
*
4734+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeBuffer)
4735+
*/
4736+
writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: AllowSharedBufferSource, dataOffset?: GPUSize64, size?: GPUSize64): void;
4737+
/**
4738+
* The **`writeTexture()`** method of the GPUQueue interface writes a provided data source into a given GPUTexture.
4739+
*
4740+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeTexture)
4741+
*/
4742+
writeTexture(destination: GPUTexelCopyTextureInfo, data: AllowSharedBufferSource, dataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D): void;
4743+
}
4744+
4745+
declare var GPUQueue: {
4746+
prototype: GPUQueue;
4747+
new(): GPUQueue;
4748+
};
4749+
46654750
/**
46664751
* The **`GPURenderBundle`** interface of the WebGPU API represents a container for pre-recorded bundles of commands.
46674752
* Available only in secure contexts.
@@ -12609,11 +12694,15 @@ type GLuint = number;
1260912694
type GLuint64 = number;
1261012695
type GPUBufferDynamicOffset = number;
1261112696
type GPUColor = number[] | GPUColorDict;
12697+
type GPUCopyExternalImageSource = ImageBitmap | ImageData | OffscreenCanvas;
12698+
type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict;
1261212699
type GPUFlagsConstant = number;
1261312700
type GPUIndex32 = number;
1261412701
type GPUIntegerCoordinate = number;
1261512702
type GPUIntegerCoordinateOut = number;
1261612703
type GPUMapModeFlags = number;
12704+
type GPUOrigin2D = GPUIntegerCoordinate[] | GPUOrigin2DDict;
12705+
type GPUOrigin3D = GPUIntegerCoordinate[] | GPUOrigin3DDict;
1261712706
type GPUSignedOffset32 = number;
1261812707
type GPUSize32 = number;
1261912708
type GPUSize32Out = number;
@@ -12815,6 +12904,27 @@ interface GPUBindingCommandsMixin {
1281512904
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: Iterable<GPUBufferDynamicOffset>): void;
1281612905
}
1281712906

12907+
interface GPUQueue {
12908+
/**
12909+
* The **`copyExternalImageToTexture()`** method of the GPUQueue interface copies a snapshot taken from a source image, video, or canvas into a given GPUTexture.
12910+
*
12911+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/copyExternalImageToTexture)
12912+
*/
12913+
copyExternalImageToTexture(source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: Iterable<GPUIntegerCoordinate>): void;
12914+
/**
12915+
* The **`submit()`** method of the GPUQueue interface schedules the execution of command buffers represented by one or more GPUCommandBuffer objects by the GPU.
12916+
*
12917+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/submit)
12918+
*/
12919+
submit(commandBuffers: Iterable<GPUCommandBuffer>): void;
12920+
/**
12921+
* The **`writeTexture()`** method of the GPUQueue interface writes a provided data source into a given GPUTexture.
12922+
*
12923+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUQueue/writeTexture)
12924+
*/
12925+
writeTexture(destination: GPUTexelCopyTextureInfo, data: AllowSharedBufferSource, dataLayout: GPUTexelCopyBufferLayout, size: Iterable<GPUIntegerCoordinate>): void;
12926+
}
12927+
1281812928
interface GPURenderPassEncoder {
1281912929
/**
1282012930
* The **`executeBundles()`** method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.

0 commit comments

Comments
 (0)