Skip to content

Commit ded5dbf

Browse files
authored
Add GPUDevice methods except creators (microsoft#2408)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent 8f8c168 commit ded5dbf

17 files changed

+488
-1
lines changed

baselines/dom.generated.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,11 @@ interface GPUExtent3DDict {
856856
width: GPUIntegerCoordinate;
857857
}
858858

859+
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
860+
colorSpace?: PredefinedColorSpace;
861+
source: HTMLVideoElement | VideoFrame;
862+
}
863+
859864
interface GPUObjectDescriptorBase {
860865
label?: string;
861866
}
@@ -15318,6 +15323,30 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
1531815323
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
1531915324
*/
1532015325
readonly queue: GPUQueue;
15326+
/**
15327+
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
15328+
*
15329+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/destroy)
15330+
*/
15331+
destroy(): void;
15332+
/**
15333+
* The **`importExternalTexture()`** method of the GPUDevice interface takes an HTMLVideoElement or a VideoFrame object as an input and returns a GPUExternalTexture wrapper object containing a snapshot of the video that can be used as a frame in GPU rendering operations.
15334+
*
15335+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/importExternalTexture)
15336+
*/
15337+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
15338+
/**
15339+
* The **`popErrorScope()`** method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred.
15340+
*
15341+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/popErrorScope)
15342+
*/
15343+
popErrorScope(): Promise<GPUError | null>;
15344+
/**
15345+
* The **`pushErrorScope()`** method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type.
15346+
*
15347+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/pushErrorScope)
15348+
*/
15349+
pushErrorScope(filter: GPUErrorFilter): void;
1532115350
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1532215351
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1532315352
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -43863,6 +43892,7 @@ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
4386343892
type GPUCanvasToneMappingMode = "extended" | "standard";
4386443893
type GPUCompilationMessageType = "error" | "info" | "warning";
4386543894
type GPUDeviceLostReason = "destroyed" | "unknown";
43895+
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
4386643896
type GPUIndexFormat = "uint16" | "uint32";
4386743897
type GPULoadOp = "clear" | "load";
4386843898
type GPUPipelineErrorReason = "internal" | "validation";

baselines/serviceworker.generated.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ interface GPUExtent3DDict {
323323
width: GPUIntegerCoordinate;
324324
}
325325

326+
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
327+
colorSpace?: PredefinedColorSpace;
328+
}
329+
326330
interface GPUObjectDescriptorBase {
327331
label?: string;
328332
}
@@ -4761,6 +4765,30 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
47614765
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
47624766
*/
47634767
readonly queue: GPUQueue;
4768+
/**
4769+
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4770+
*
4771+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/destroy)
4772+
*/
4773+
destroy(): void;
4774+
/**
4775+
* The **`importExternalTexture()`** method of the GPUDevice interface takes an HTMLVideoElement or a VideoFrame object as an input and returns a GPUExternalTexture wrapper object containing a snapshot of the video that can be used as a frame in GPU rendering operations.
4776+
*
4777+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/importExternalTexture)
4778+
*/
4779+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
4780+
/**
4781+
* The **`popErrorScope()`** method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred.
4782+
*
4783+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/popErrorScope)
4784+
*/
4785+
popErrorScope(): Promise<GPUError | null>;
4786+
/**
4787+
* The **`pushErrorScope()`** method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type.
4788+
*
4789+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/pushErrorScope)
4790+
*/
4791+
pushErrorScope(filter: GPUErrorFilter): void;
47644792
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
47654793
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
47664794
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -12996,6 +13024,7 @@ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
1299613024
type GPUCanvasToneMappingMode = "extended" | "standard";
1299713025
type GPUCompilationMessageType = "error" | "info" | "warning";
1299813026
type GPUDeviceLostReason = "destroyed" | "unknown";
13027+
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
1299913028
type GPUIndexFormat = "uint16" | "uint32";
1300013029
type GPULoadOp = "clear" | "load";
1300113030
type GPUPipelineErrorReason = "internal" | "validation";

baselines/sharedworker.generated.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ interface GPUExtent3DDict {
267267
width: GPUIntegerCoordinate;
268268
}
269269

270+
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
271+
colorSpace?: PredefinedColorSpace;
272+
}
273+
270274
interface GPUObjectDescriptorBase {
271275
label?: string;
272276
}
@@ -4444,6 +4448,30 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
44444448
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
44454449
*/
44464450
readonly queue: GPUQueue;
4451+
/**
4452+
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4453+
*
4454+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/destroy)
4455+
*/
4456+
destroy(): void;
4457+
/**
4458+
* The **`importExternalTexture()`** method of the GPUDevice interface takes an HTMLVideoElement or a VideoFrame object as an input and returns a GPUExternalTexture wrapper object containing a snapshot of the video that can be used as a frame in GPU rendering operations.
4459+
*
4460+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/importExternalTexture)
4461+
*/
4462+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
4463+
/**
4464+
* The **`popErrorScope()`** method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred.
4465+
*
4466+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/popErrorScope)
4467+
*/
4468+
popErrorScope(): Promise<GPUError | null>;
4469+
/**
4470+
* The **`pushErrorScope()`** method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type.
4471+
*
4472+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/pushErrorScope)
4473+
*/
4474+
pushErrorScope(filter: GPUErrorFilter): void;
44474475
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
44484476
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
44494477
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -12668,6 +12696,7 @@ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
1266812696
type GPUCanvasToneMappingMode = "extended" | "standard";
1266912697
type GPUCompilationMessageType = "error" | "info" | "warning";
1267012698
type GPUDeviceLostReason = "destroyed" | "unknown";
12699+
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
1267112700
type GPUIndexFormat = "uint16" | "uint32";
1267212701
type GPULoadOp = "clear" | "load";
1267312702
type GPUPipelineErrorReason = "internal" | "validation";

baselines/ts5.5/dom.generated.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,11 @@ interface GPUExtent3DDict {
853853
width: GPUIntegerCoordinate;
854854
}
855855

856+
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
857+
colorSpace?: PredefinedColorSpace;
858+
source: HTMLVideoElement | VideoFrame;
859+
}
860+
856861
interface GPUObjectDescriptorBase {
857862
label?: string;
858863
}
@@ -15304,6 +15309,30 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
1530415309
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
1530515310
*/
1530615311
readonly queue: GPUQueue;
15312+
/**
15313+
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
15314+
*
15315+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/destroy)
15316+
*/
15317+
destroy(): void;
15318+
/**
15319+
* The **`importExternalTexture()`** method of the GPUDevice interface takes an HTMLVideoElement or a VideoFrame object as an input and returns a GPUExternalTexture wrapper object containing a snapshot of the video that can be used as a frame in GPU rendering operations.
15320+
*
15321+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/importExternalTexture)
15322+
*/
15323+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
15324+
/**
15325+
* The **`popErrorScope()`** method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred.
15326+
*
15327+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/popErrorScope)
15328+
*/
15329+
popErrorScope(): Promise<GPUError | null>;
15330+
/**
15331+
* The **`pushErrorScope()`** method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type.
15332+
*
15333+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/pushErrorScope)
15334+
*/
15335+
pushErrorScope(filter: GPUErrorFilter): void;
1530715336
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1530815337
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1530915338
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -43837,6 +43866,7 @@ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
4383743866
type GPUCanvasToneMappingMode = "extended" | "standard";
4383843867
type GPUCompilationMessageType = "error" | "info" | "warning";
4383943868
type GPUDeviceLostReason = "destroyed" | "unknown";
43869+
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
4384043870
type GPUIndexFormat = "uint16" | "uint32";
4384143871
type GPULoadOp = "clear" | "load";
4384243872
type GPUPipelineErrorReason = "internal" | "validation";

baselines/ts5.5/serviceworker.generated.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ interface GPUExtent3DDict {
320320
width: GPUIntegerCoordinate;
321321
}
322322

323+
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
324+
colorSpace?: PredefinedColorSpace;
325+
}
326+
323327
interface GPUObjectDescriptorBase {
324328
label?: string;
325329
}
@@ -4758,6 +4762,30 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
47584762
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
47594763
*/
47604764
readonly queue: GPUQueue;
4765+
/**
4766+
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4767+
*
4768+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/destroy)
4769+
*/
4770+
destroy(): void;
4771+
/**
4772+
* The **`importExternalTexture()`** method of the GPUDevice interface takes an HTMLVideoElement or a VideoFrame object as an input and returns a GPUExternalTexture wrapper object containing a snapshot of the video that can be used as a frame in GPU rendering operations.
4773+
*
4774+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/importExternalTexture)
4775+
*/
4776+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
4777+
/**
4778+
* The **`popErrorScope()`** method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred.
4779+
*
4780+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/popErrorScope)
4781+
*/
4782+
popErrorScope(): Promise<GPUError | null>;
4783+
/**
4784+
* The **`pushErrorScope()`** method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type.
4785+
*
4786+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/pushErrorScope)
4787+
*/
4788+
pushErrorScope(filter: GPUErrorFilter): void;
47614789
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
47624790
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
47634791
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -12993,6 +13021,7 @@ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
1299313021
type GPUCanvasToneMappingMode = "extended" | "standard";
1299413022
type GPUCompilationMessageType = "error" | "info" | "warning";
1299513023
type GPUDeviceLostReason = "destroyed" | "unknown";
13024+
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
1299613025
type GPUIndexFormat = "uint16" | "uint32";
1299713026
type GPULoadOp = "clear" | "load";
1299813027
type GPUPipelineErrorReason = "internal" | "validation";

baselines/ts5.5/sharedworker.generated.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ interface GPUExtent3DDict {
264264
width: GPUIntegerCoordinate;
265265
}
266266

267+
interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
268+
colorSpace?: PredefinedColorSpace;
269+
}
270+
267271
interface GPUObjectDescriptorBase {
268272
label?: string;
269273
}
@@ -4441,6 +4445,30 @@ interface GPUDevice extends EventTarget, GPUObjectBase {
44414445
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
44424446
*/
44434447
readonly queue: GPUQueue;
4448+
/**
4449+
* The **`destroy()`** method of the GPUDevice interface destroys the device, preventing further operations on it.
4450+
*
4451+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/destroy)
4452+
*/
4453+
destroy(): void;
4454+
/**
4455+
* The **`importExternalTexture()`** method of the GPUDevice interface takes an HTMLVideoElement or a VideoFrame object as an input and returns a GPUExternalTexture wrapper object containing a snapshot of the video that can be used as a frame in GPU rendering operations.
4456+
*
4457+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/importExternalTexture)
4458+
*/
4459+
importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture;
4460+
/**
4461+
* The **`popErrorScope()`** method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred.
4462+
*
4463+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/popErrorScope)
4464+
*/
4465+
popErrorScope(): Promise<GPUError | null>;
4466+
/**
4467+
* The **`pushErrorScope()`** method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type.
4468+
*
4469+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/pushErrorScope)
4470+
*/
4471+
pushErrorScope(filter: GPUErrorFilter): void;
44444472
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
44454473
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
44464474
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -12665,6 +12693,7 @@ type GPUCanvasAlphaMode = "opaque" | "premultiplied";
1266512693
type GPUCanvasToneMappingMode = "extended" | "standard";
1266612694
type GPUCompilationMessageType = "error" | "info" | "warning";
1266712695
type GPUDeviceLostReason = "destroyed" | "unknown";
12696+
type GPUErrorFilter = "internal" | "out-of-memory" | "validation";
1266812697
type GPUIndexFormat = "uint16" | "uint32";
1266912698
type GPULoadOp = "clear" | "load";
1267012699
type GPUPipelineErrorReason = "internal" | "validation";

0 commit comments

Comments
 (0)