1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(ext/webgpu): make GPUDevice.features SetLike (#15853)

This commit is contained in:
Vicary A 2022-09-20 09:43:32 +08:00 committed by David Sherret
parent ff5747264c
commit 29c0951bd4
2 changed files with 8 additions and 9 deletions

View file

@ -143,8 +143,8 @@ declare class GPUDevice extends EventTarget implements GPUObjectBase {
| ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any)
| null;
readonly features: ReadonlyArray<GPUFeatureName>;
readonly limits: Record<string, number>;
readonly features: GPUSupportedFeatures;
readonly limits: GPUSupportedLimits;
readonly queue: GPUQueue;
destroy(): undefined;

View file

@ -25,7 +25,6 @@
Error,
MathMax,
ObjectDefineProperty,
ObjectFreeze,
ObjectPrototypeIsPrototypeOf,
Promise,
PromiseAll,
@ -344,8 +343,8 @@
const inner = new InnerGPUDevice({
rid,
adapter: this,
features: ObjectFreeze(features),
limits: ObjectFreeze(limits),
features: createGPUSupportedFeatures(features),
limits: createGPUSupportedLimits(limits),
});
return createGPUDevice(
descriptor.label ?? null,
@ -744,8 +743,8 @@
* @typedef InnerGPUDeviceOptions
* @property {GPUAdapter} adapter
* @property {number | undefined} rid
* @property {GPUFeatureName[]} features
* @property {object} limits
* @property {GPUSupportedFeatures} features
* @property {GPUSupportedLimits} limits
*/
class InnerGPUDevice {
@ -753,9 +752,9 @@
adapter;
/** @type {number | undefined} */
rid;
/** @type {GPUFeatureName[]} */
/** @type {GPUSupportedFeatures} */
features;
/** @type {object} */
/** @type {GPUSupportedLimits} */
limits;
/** @type {WeakRef<any>[]} */
resources;