Skip to content

Commit

Permalink
webgpu/idl: Initialize the GPU (#765)
Browse files Browse the repository at this point in the history
Call `getGPU()` to ensure the GPU provider has a chance to initialize.
Without this, when running with non-web implementations, GPU globals may not be registered, causing tests to fail.
  • Loading branch information
ben-clayton authored Sep 30, 2021
1 parent 6ff5dc6 commit e100dde
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/webgpu/idl/idl_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Fixture } from '../../common/framework/fixture.js';
import { getGPU } from '../../common/util/navigator_gpu.js';
import { assert } from '../../common/util/util.js';

interface UnknownObject {
Expand All @@ -11,6 +12,11 @@ interface UnknownObject {
export class IDLTest extends Fixture {
// TODO: add a helper to check prototype chains

async init(): Promise<void> {
// Ensure the GPU provider is initialized
getGPU();
}

/**
* Asserts that a member of an IDL interface has the expected value.
*/
Expand Down

0 comments on commit e100dde

Please sign in to comment.