From e100dde44ba25ab533bbc79ef1996fa0a1777530 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 30 Sep 2021 20:50:05 +0100 Subject: [PATCH] webgpu/idl: Initialize the GPU (#765) 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. --- src/webgpu/idl/idl_test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/webgpu/idl/idl_test.ts b/src/webgpu/idl/idl_test.ts index a2119d2201e2..c67b708b439c 100644 --- a/src/webgpu/idl/idl_test.ts +++ b/src/webgpu/idl/idl_test.ts @@ -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 { @@ -11,6 +12,11 @@ interface UnknownObject { export class IDLTest extends Fixture { // TODO: add a helper to check prototype chains + async init(): Promise { + // Ensure the GPU provider is initialized + getGPU(); + } + /** * Asserts that a member of an IDL interface has the expected value. */