dawn-cmake/src/dawn_node
Ben Clayton 34206ec07b dawn_node: Use wgpu::SupportedLimits
Query the Adapter / Device for limits instead of hardcoding them.

Bug: dawn:1143
Change-Id: Ib6d47bdb81df8e5e6eb767d35d346bbf34c5877a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65722
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-10-11 15:42:12 +00:00
..
binding dawn_node: Use wgpu::SupportedLimits 2021-10-11 15:42:12 +00:00
interop dawn_node/interop: Return a Result instead of a bool 2021-10-05 19:44:09 +00:00
tools run-cts: add "log" arg to log test results to file 2021-10-05 21:18:10 +00:00
utils dawn_node: Fix macOS build 2021-09-30 18:04:01 +00:00
CMakeLists.txt Revert "Add deps to enable performing the cmake build of dawn_node on CQ" 2021-10-04 23:35:49 +00:00
Module.cpp dawn_node: Add Module.cpp 2021-09-29 09:51:21 +00:00
NapiSymbols.cpp dawn_node: Fix Windows build 2021-09-30 18:51:40 +00:00
README.md dawn_node: Use IDL default parameter values 2021-10-05 19:32:34 +00:00

README.md

Dawn bindings for NodeJS

Note: This code is currently WIP. There are a number of known issues.

Building

System requirements

Install depot_tools

Dawn uses the Chromium build system and dependency management so you need to install depot_tools and add it to the PATH.

Fetch dependencies

First, the steps are similar to doc/building.md, but instead of the Get the code step, run:

# Clone the repo as "dawn"
git clone https://dawn.googlesource.com/dawn dawn && cd dawn

# Bootstrap the NodeJS binding gclient configuration
cp scripts/standalone-with-node.gclient .gclient

# Fetch external dependencies and toolchains with gclient
gclient sync

Build

Currently, the node bindings can only be built with CMake:

mkdir <build-output-path>
cd <build-output-path>
cmake <dawn-root-path> -GNinja -DDAWN_BUILD_NODE_BINDINGS=1 -DDAWN_ENABLE_PIC=1
ninja dawn.node

Running WebGPU CTS

  1. Build the dawn.node NodeJS module.
  2. Checkout the WebGPU CTS repo
./src/dawn_node/tools/run-cts --cts=<path-to-webgpu-cts> --dawn-node=<path-to-dawn.node> [WebGPU CTS query]

If this fails with the error message TypeError: expander is not a function or its return value is not iterable, try appending --build=false to the start of the run-cts command line flags.

To test against SwiftShader instead of the default Vulkan device, prefix ./src/dawn_node/tools/run-cts with VK_ICD_FILENAMES=<swiftshader-cmake-build>/Linux/vk_swiftshader_icd.json

Known issues

  • Many WebGPU CTS tests are currently known to fail
  • Dawn uses special token values for some parameters / fields. These are currently passed straight through to dawn from the JavaScript. discussions: 1, 2, 3
  • Backend validation is currently always set to 'full' to aid in debugging. This can be extremely slow. discussion
  • Attempting to call new T in JavaScript, where T is an IDL interface type, should result in a TypeError "Illegal constructor". discussion
  • GPUDevice currently maintains a list of "lost promises". This should return the same promise. discussion

Remaining work