Skip to content

Commit

Permalink
Assert GPUAdapterInfo instances (gpuweb#4034)
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois authored Nov 6, 2024
1 parent 0d22c00 commit 447b667
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/webgpu/api/operation/adapter/info.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ but different objects from one another.`
const gpu = getGPU(t.rec);
const adapter = await gpu.requestAdapter();
assert(adapter !== null);
assert(adapter.info instanceof GPUAdapterInfo);

const adapterInfo1 = adapter.info;
const adapterInfo2 = adapter.info;
t.expect(adapterInfo1 === adapterInfo2, 'adapter.info should obey [SameObject]');

const device = await t.requestDeviceTracked(adapter);
assert(device !== null);
assert(device.adapterInfo instanceof GPUAdapterInfo);

const deviceAdapterInfo1 = device.adapterInfo;
const deviceAdapterInfo2 = device.adapterInfo;
Expand Down

0 comments on commit 447b667

Please sign in to comment.