Skip to content

Commit 0dab062

Browse files
authored
Add GPUDevice except methods (#2405)
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
1 parent bfd2e96 commit 0dab062

17 files changed

+883
-1
lines changed

baselines/dom.generated.d.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ interface FullscreenOptions {
808808
interface GPUCanvasConfiguration {
809809
alphaMode?: GPUCanvasAlphaMode;
810810
colorSpace?: PredefinedColorSpace;
811+
device: GPUDevice;
811812
format: GPUTextureFormat;
812813
toneMapping?: GPUCanvasToneMapping;
813814
usage?: GPUTextureUsageFlags;
@@ -15274,6 +15275,60 @@ interface GPUDebugCommandsMixin {
1527415275
pushDebugGroup(groupLabel: string): void;
1527515276
}
1527615277

15278+
interface GPUDeviceEventMap {
15279+
"uncapturederror": GPUUncapturedErrorEvent;
15280+
}
15281+
15282+
/**
15283+
* The **`GPUDevice`** interface of the WebGPU API represents a logical GPU device. This is the main interface through which the majority of WebGPU functionality is accessed.
15284+
* Available only in secure contexts.
15285+
*
15286+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice)
15287+
*/
15288+
interface GPUDevice extends EventTarget, GPUObjectBase {
15289+
/**
15290+
* The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.
15291+
*
15292+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo)
15293+
*/
15294+
readonly adapterInfo: GPUAdapterInfo;
15295+
/**
15296+
* The **`features`** read-only property of the GPUDevice interface returns a GPUSupportedFeatures object that describes additional functionality supported by the device. Only features requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) are included.
15297+
*
15298+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features)
15299+
*/
15300+
readonly features: GPUSupportedFeatures;
15301+
/**
15302+
* The **`limits`** read-only property of the GPUDevice interface returns a GPUSupportedLimits object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) will be reflected in those values.
15303+
*
15304+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits)
15305+
*/
15306+
readonly limits: GPUSupportedLimits;
15307+
/**
15308+
* The **`lost`** read-only property of the GPUDevice interface contains a Promise that remains pending throughout the device's lifetime and resolves with a GPUDeviceLostInfo object when the device is lost.
15309+
*
15310+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost)
15311+
*/
15312+
readonly lost: Promise<GPUDeviceLostInfo>;
15313+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */
15314+
onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
15315+
/**
15316+
* The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device.
15317+
*
15318+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
15319+
*/
15320+
readonly queue: GPUQueue;
15321+
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
15322+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
15323+
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
15324+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
15325+
}
15326+
15327+
declare var GPUDevice: {
15328+
prototype: GPUDevice;
15329+
new(): GPUDevice;
15330+
};
15331+
1527715332
/**
1527815333
* The **`GPUDeviceLostInfo`** interface of the WebGPU API represents the object returned when the GPUDevice.lost Promise resolves. This provides information as to why a device has been lost.
1527915334
* Available only in secure contexts.

baselines/serviceworker.generated.d.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ interface FontFaceSetLoadEventInit extends EventInit {
275275
interface GPUCanvasConfiguration {
276276
alphaMode?: GPUCanvasAlphaMode;
277277
colorSpace?: PredefinedColorSpace;
278+
device: GPUDevice;
278279
format: GPUTextureFormat;
279280
toneMapping?: GPUCanvasToneMapping;
280281
usage?: GPUTextureUsageFlags;
@@ -4717,6 +4718,60 @@ interface GPUDebugCommandsMixin {
47174718
pushDebugGroup(groupLabel: string): void;
47184719
}
47194720

4721+
interface GPUDeviceEventMap {
4722+
"uncapturederror": GPUUncapturedErrorEvent;
4723+
}
4724+
4725+
/**
4726+
* The **`GPUDevice`** interface of the WebGPU API represents a logical GPU device. This is the main interface through which the majority of WebGPU functionality is accessed.
4727+
* Available only in secure contexts.
4728+
*
4729+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice)
4730+
*/
4731+
interface GPUDevice extends EventTarget, GPUObjectBase {
4732+
/**
4733+
* The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.
4734+
*
4735+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo)
4736+
*/
4737+
readonly adapterInfo: GPUAdapterInfo;
4738+
/**
4739+
* The **`features`** read-only property of the GPUDevice interface returns a GPUSupportedFeatures object that describes additional functionality supported by the device. Only features requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) are included.
4740+
*
4741+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features)
4742+
*/
4743+
readonly features: GPUSupportedFeatures;
4744+
/**
4745+
* The **`limits`** read-only property of the GPUDevice interface returns a GPUSupportedLimits object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) will be reflected in those values.
4746+
*
4747+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits)
4748+
*/
4749+
readonly limits: GPUSupportedLimits;
4750+
/**
4751+
* The **`lost`** read-only property of the GPUDevice interface contains a Promise that remains pending throughout the device's lifetime and resolves with a GPUDeviceLostInfo object when the device is lost.
4752+
*
4753+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost)
4754+
*/
4755+
readonly lost: Promise<GPUDeviceLostInfo>;
4756+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */
4757+
onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
4758+
/**
4759+
* The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device.
4760+
*
4761+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
4762+
*/
4763+
readonly queue: GPUQueue;
4764+
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
4765+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
4766+
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
4767+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
4768+
}
4769+
4770+
declare var GPUDevice: {
4771+
prototype: GPUDevice;
4772+
new(): GPUDevice;
4773+
};
4774+
47204775
/**
47214776
* The **`GPUDeviceLostInfo`** interface of the WebGPU API represents the object returned when the GPUDevice.lost Promise resolves. This provides information as to why a device has been lost.
47224777
* Available only in secure contexts.

baselines/sharedworker.generated.d.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ interface FontFaceSetLoadEventInit extends EventInit {
219219
interface GPUCanvasConfiguration {
220220
alphaMode?: GPUCanvasAlphaMode;
221221
colorSpace?: PredefinedColorSpace;
222+
device: GPUDevice;
222223
format: GPUTextureFormat;
223224
toneMapping?: GPUCanvasToneMapping;
224225
usage?: GPUTextureUsageFlags;
@@ -4400,6 +4401,60 @@ interface GPUDebugCommandsMixin {
44004401
pushDebugGroup(groupLabel: string): void;
44014402
}
44024403

4404+
interface GPUDeviceEventMap {
4405+
"uncapturederror": GPUUncapturedErrorEvent;
4406+
}
4407+
4408+
/**
4409+
* The **`GPUDevice`** interface of the WebGPU API represents a logical GPU device. This is the main interface through which the majority of WebGPU functionality is accessed.
4410+
* Available only in secure contexts.
4411+
*
4412+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice)
4413+
*/
4414+
interface GPUDevice extends EventTarget, GPUObjectBase {
4415+
/**
4416+
* The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.
4417+
*
4418+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo)
4419+
*/
4420+
readonly adapterInfo: GPUAdapterInfo;
4421+
/**
4422+
* The **`features`** read-only property of the GPUDevice interface returns a GPUSupportedFeatures object that describes additional functionality supported by the device. Only features requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) are included.
4423+
*
4424+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features)
4425+
*/
4426+
readonly features: GPUSupportedFeatures;
4427+
/**
4428+
* The **`limits`** read-only property of the GPUDevice interface returns a GPUSupportedLimits object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) will be reflected in those values.
4429+
*
4430+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits)
4431+
*/
4432+
readonly limits: GPUSupportedLimits;
4433+
/**
4434+
* The **`lost`** read-only property of the GPUDevice interface contains a Promise that remains pending throughout the device's lifetime and resolves with a GPUDeviceLostInfo object when the device is lost.
4435+
*
4436+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost)
4437+
*/
4438+
readonly lost: Promise<GPUDeviceLostInfo>;
4439+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */
4440+
onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
4441+
/**
4442+
* The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device.
4443+
*
4444+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
4445+
*/
4446+
readonly queue: GPUQueue;
4447+
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
4448+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
4449+
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
4450+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
4451+
}
4452+
4453+
declare var GPUDevice: {
4454+
prototype: GPUDevice;
4455+
new(): GPUDevice;
4456+
};
4457+
44034458
/**
44044459
* The **`GPUDeviceLostInfo`** interface of the WebGPU API represents the object returned when the GPUDevice.lost Promise resolves. This provides information as to why a device has been lost.
44054460
* Available only in secure contexts.

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ interface FullscreenOptions {
805805
interface GPUCanvasConfiguration {
806806
alphaMode?: GPUCanvasAlphaMode;
807807
colorSpace?: PredefinedColorSpace;
808+
device: GPUDevice;
808809
format: GPUTextureFormat;
809810
toneMapping?: GPUCanvasToneMapping;
810811
usage?: GPUTextureUsageFlags;
@@ -15260,6 +15261,60 @@ interface GPUDebugCommandsMixin {
1526015261
pushDebugGroup(groupLabel: string): void;
1526115262
}
1526215263

15264+
interface GPUDeviceEventMap {
15265+
"uncapturederror": GPUUncapturedErrorEvent;
15266+
}
15267+
15268+
/**
15269+
* The **`GPUDevice`** interface of the WebGPU API represents a logical GPU device. This is the main interface through which the majority of WebGPU functionality is accessed.
15270+
* Available only in secure contexts.
15271+
*
15272+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice)
15273+
*/
15274+
interface GPUDevice extends EventTarget, GPUObjectBase {
15275+
/**
15276+
* The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.
15277+
*
15278+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo)
15279+
*/
15280+
readonly adapterInfo: GPUAdapterInfo;
15281+
/**
15282+
* The **`features`** read-only property of the GPUDevice interface returns a GPUSupportedFeatures object that describes additional functionality supported by the device. Only features requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) are included.
15283+
*
15284+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features)
15285+
*/
15286+
readonly features: GPUSupportedFeatures;
15287+
/**
15288+
* The **`limits`** read-only property of the GPUDevice interface returns a GPUSupportedLimits object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) will be reflected in those values.
15289+
*
15290+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits)
15291+
*/
15292+
readonly limits: GPUSupportedLimits;
15293+
/**
15294+
* The **`lost`** read-only property of the GPUDevice interface contains a Promise that remains pending throughout the device's lifetime and resolves with a GPUDeviceLostInfo object when the device is lost.
15295+
*
15296+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost)
15297+
*/
15298+
readonly lost: Promise<GPUDeviceLostInfo>;
15299+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */
15300+
onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
15301+
/**
15302+
* The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device.
15303+
*
15304+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
15305+
*/
15306+
readonly queue: GPUQueue;
15307+
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
15308+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
15309+
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
15310+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
15311+
}
15312+
15313+
declare var GPUDevice: {
15314+
prototype: GPUDevice;
15315+
new(): GPUDevice;
15316+
};
15317+
1526315318
/**
1526415319
* The **`GPUDeviceLostInfo`** interface of the WebGPU API represents the object returned when the GPUDevice.lost Promise resolves. This provides information as to why a device has been lost.
1526515320
* Available only in secure contexts.

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ interface FontFaceSetLoadEventInit extends EventInit {
272272
interface GPUCanvasConfiguration {
273273
alphaMode?: GPUCanvasAlphaMode;
274274
colorSpace?: PredefinedColorSpace;
275+
device: GPUDevice;
275276
format: GPUTextureFormat;
276277
toneMapping?: GPUCanvasToneMapping;
277278
usage?: GPUTextureUsageFlags;
@@ -4714,6 +4715,60 @@ interface GPUDebugCommandsMixin {
47144715
pushDebugGroup(groupLabel: string): void;
47154716
}
47164717

4718+
interface GPUDeviceEventMap {
4719+
"uncapturederror": GPUUncapturedErrorEvent;
4720+
}
4721+
4722+
/**
4723+
* The **`GPUDevice`** interface of the WebGPU API represents a logical GPU device. This is the main interface through which the majority of WebGPU functionality is accessed.
4724+
* Available only in secure contexts.
4725+
*
4726+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice)
4727+
*/
4728+
interface GPUDevice extends EventTarget, GPUObjectBase {
4729+
/**
4730+
* The **`adapterInfo`** read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.
4731+
*
4732+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/adapterInfo)
4733+
*/
4734+
readonly adapterInfo: GPUAdapterInfo;
4735+
/**
4736+
* The **`features`** read-only property of the GPUDevice interface returns a GPUSupportedFeatures object that describes additional functionality supported by the device. Only features requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) are included.
4737+
*
4738+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/features)
4739+
*/
4740+
readonly features: GPUSupportedFeatures;
4741+
/**
4742+
* The **`limits`** read-only property of the GPUDevice interface returns a GPUSupportedLimits object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) will be reflected in those values.
4743+
*
4744+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/limits)
4745+
*/
4746+
readonly limits: GPUSupportedLimits;
4747+
/**
4748+
* The **`lost`** read-only property of the GPUDevice interface contains a Promise that remains pending throughout the device's lifetime and resolves with a GPUDeviceLostInfo object when the device is lost.
4749+
*
4750+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/lost)
4751+
*/
4752+
readonly lost: Promise<GPUDeviceLostInfo>;
4753+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/uncapturederror_event) */
4754+
onuncapturederror: ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) | null;
4755+
/**
4756+
* The **`queue`** read-only property of the GPUDevice interface returns the primary GPUQueue for the device.
4757+
*
4758+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/GPUDevice/queue)
4759+
*/
4760+
readonly queue: GPUQueue;
4761+
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
4762+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
4763+
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
4764+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
4765+
}
4766+
4767+
declare var GPUDevice: {
4768+
prototype: GPUDevice;
4769+
new(): GPUDevice;
4770+
};
4771+
47174772
/**
47184773
* The **`GPUDeviceLostInfo`** interface of the WebGPU API represents the object returned when the GPUDevice.lost Promise resolves. This provides information as to why a device has been lost.
47194774
* Available only in secure contexts.

0 commit comments

Comments
 (0)