From 2929ec9ffa70758f5481704e4de975dc61993f74 Mon Sep 17 00:00:00 2001 From: Vicary A Date: Tue, 20 Sep 2022 09:43:32 +0800 Subject: fix(ext/webgpu): make GPUDevice.features SetLike (#15853) --- ext/webgpu/src/01_webgpu.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'ext/webgpu/src') diff --git a/ext/webgpu/src/01_webgpu.js b/ext/webgpu/src/01_webgpu.js index 9b8c7eb50..caa103e62 100644 --- a/ext/webgpu/src/01_webgpu.js +++ b/ext/webgpu/src/01_webgpu.js @@ -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[]} */ resources; -- cgit v1.2.3