[dawn.node] Fix dawn.node in workers. The native addon used a static variable `Wrappers::instance` to store persistent Napi handles (constructors). This caused crashes in multi-threaded environments because: 1. One thread would overwrite the static pointer with handles tied to its own Napi::Env. 2. Other threads would then attempt to use those foreign handles in their own environments. 3. V8/NAPI would fail with a fatal handle scope error or segmentation fault. This fix replaces the static instance with `Napi::Env::SetInstanceData`, ensuring each worker thread (Napi environment) maintains its own isolated set of constructor handles. Added tests to test.mjs Bug: 493513165 Fixes: 493513165 Change-Id: I247d58240bbc9f4f83929d8a3c7c00db778a759d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/297816 Auto-Submit: Gregg Tavares <gman@chromium.org> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.