// GPUProviderModule for gpuweb/cts's tools/run_node (--gpu-provider). // Wraps the prebuilt dawn.node binding shipped by the "webgpu" npm package // (dawn-gpu/node-webgpu), so the CTS's own runner drives Dawn directly with // no browser involved. Vulkan driver selection happens outside this file, // via VK_ICD_FILENAMES/VK_DRIVER_FILES pointed at lavapipe before node starts. const { create, globals } = require('webgpu'); // The CTS framework does `instanceof GPUDevice` and similar checks against // the IDL constructors as globals (true in a browser, where they hang off // `window`); dawn.node only hands them back from create(), so they have to // be installed onto globalThis here or every such check throws // ReferenceError before any test runs. Object.assign(globalThis, globals); module.exports = { create(flags) { return create(flags); }, };