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) | ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any)
| null; | null;
readonly features: ReadonlyArray<GPUFeatureName>; readonly features: GPUSupportedFeatures;
readonly limits: Record<string, number>; readonly limits: GPUSupportedLimits;
readonly queue: GPUQueue; readonly queue: GPUQueue;
destroy(): undefined; destroy(): undefined;

View file

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