From cac7ecc74b58e2b043afc28876f067caea7e915e Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Fri, 3 Jan 2025 20:17:07 -0800 Subject: [PATCH] Turn off X11 --- README.md | 19 +++++++++++++++++++ build/build.js | 1 + 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index c4c60cb..fad1644 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,25 @@ This is a script to bundle/package dawn.node and hopefully publish it on npm [Dawn](https://dawn.googlesource.com/dawn) is an implementation of [WebGPU](https://gpuweb.github.io/gpuweb/). It includes a node plugin and this repo builds that plugin. +# Usage + +TDB + +Note: This package provides a WebGPU implementation it node. That said, if you are making a webpage +and are considering using this for testing, you'd probably be better off using puppeteer. You can +find an example of using puppeteer for testing WebGPU in [this repo](https://github.com/greggman/webgpu-debug-helper). + +This package is for WebGPU in node. It provides WebGPU in node. But it doesn't not provide integration +with the web platform. For example, importing video via `HTMLVideoElement` or `VideoFrame`. It doesn't +provide a way to copy an `HTMLImageElement` to a texture. It also doesn't provide a way to render to an +`HTMLCanvasElement`. All of those only exist in the browser, not in node. + +I suspect you could provide many of those with polyfills without changing this repo but I have not +looked into it. + +What you can do is render to textures and then read them back. You can also run compute shaders +and read their results. + # Updating This updates to the latest dawn and depot_tools diff --git a/build/build.js b/build/build.js index 4c418a7..688c36c 100644 --- a/build/build.js +++ b/build/build.js @@ -44,6 +44,7 @@ async function buildDawnNode() { dawnPath, ...addElemIf(!isWin, '-GNinja'), '-DDAWN_BUILD_NODE_BINDINGS=1', + '-DDAWN_USE_X11=OFF', ...addElemIf(isMac, '-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'), ]); if (isWin) {