diff options
author | Vicary A <vicary@yahoo.com> | 2022-09-20 09:43:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 03:43:32 +0200 |
commit | 2929ec9ffa70758f5481704e4de975dc61993f74 (patch) | |
tree | df38f013826813a80805795df396aac5c66d182f | |
parent | 73e89844bab930f2a2821b059743faed8372ed14 (diff) |
fix(ext/webgpu): make GPUDevice.features SetLike (#15853)
-rw-r--r-- | cli/dts/lib.deno_webgpu.d.ts | 4 | ||||
-rw-r--r-- | ext/webgpu/src/01_webgpu.js | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/cli/dts/lib.deno_webgpu.d.ts b/cli/dts/lib.deno_webgpu.d.ts index efcc8da4a..32f142768 100644 --- a/cli/dts/lib.deno_webgpu.d.ts +++ b/cli/dts/lib.deno_webgpu.d.ts @@ -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; 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<any>[]} */ resources; |