From a5193704f62b72c46ed4accada79307009cde7a6 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 3 Mar 2023 14:23:39 +0000 Subject: [PATCH] dawn/native: Initialize tint Bug: tint:1853 Change-Id: Id6242163f0670a62ed94ac01dcd575b403145b4e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122383 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Ben Clayton Kokoro: Kokoro --- src/dawn/native/DawnNative.cpp | 5 ++++- src/dawn/node/Module.cpp | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) 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());