diff --git a/src/dawn/native/DawnNative.cpp b/src/dawn/native/DawnNative.cpp index 5e9f39b7e7..5bdf2a17bd 100644 --- a/src/dawn/native/DawnNative.cpp +++ b/src/dawn/native/DawnNative.cpp @@ -23,6 +23,7 @@ #include "dawn/native/Instance.h" #include "dawn/native/Texture.h" #include "dawn/platform/DawnPlatform.h" +#include "tint/tint.h" // Contains the entry-points into dawn_native @@ -187,7 +188,9 @@ AdapterDiscoveryOptionsBase::AdapterDiscoveryOptionsBase(WGPUBackendType type) // Instance Instance::Instance(const WGPUInstanceDescriptor* desc) - : mImpl(APICreateInstance(reinterpret_cast(desc))) {} + : mImpl(APICreateInstance(reinterpret_cast(desc))) { + tint::Initialize(); +} Instance::~Instance() { if (mImpl != nullptr) { diff --git a/src/dawn/node/Module.cpp b/src/dawn/node/Module.cpp index 96afacc998..1110ec94f7 100644 --- a/src/dawn/node/Module.cpp +++ b/src/dawn/node/Module.cpp @@ -91,9 +91,6 @@ struct Coverage { // types into the global object, and adding the 'create' function on the exported // object. Napi::Object Initialize(Napi::Env env, Napi::Object exports) { - // Initialize Tint - tint::Initialize(); - // Set all the Dawn procedure function pointers. dawnProcSetProcs(&dawn::native::GetProcs());