Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maierfelix/webgpu
WebGPU for Node [Deprecated, Unmaintained]
https://github.com/maierfelix/webgpu
Last synced: 7 days ago
JSON representation
WebGPU for Node [Deprecated, Unmaintained]
- Host: GitHub
- URL: https://github.com/maierfelix/webgpu
- Owner: maierfelix
- License: mit
- Created: 2019-09-11T18:21:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-26T00:32:19.000Z (almost 3 years ago)
- Last Synced: 2024-12-29T01:15:46.339Z (14 days ago)
- Language: C
- Homepage:
- Size: 622 MB
- Stars: 244
- Watchers: 14
- Forks: 17
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-webgpu - WebGPU for Node - Based on Dawn (Libraries / Try out WebGPU)
README
This is a WebGPU API for native JavaScript, based on a Fork of Chromium's Dawn Project.
### Platforms
This project comes with pre-built N-API binaries for the following platforms:
| OS | Status |
| ------------- | ------------- |
| Windows | ✔ |
| Linux | ✔ |
| MacOS | ✔ |### Installation
````
npm install webgpu
````## Building
You have to build [dawn](https://dawn.googlesource.com/dawn) as a shared library.
After building dawn, create a file named `PATH_TO_DAWN` in this project's root directory, containing the **absolute** path to dawn.In case you have multiple python installations, you might want to use the `--script-executable` gn flag to instruct *gn* to use the python 2.x installation.
After you have generated and built dawn, you can now build this project by running:
````
npm run all --dawnversion=0.0.1
````### Windows
Follow dawn's initial setup instructions, but instead of the standard build, do the following:
To generate the project as a shared library using MSVS:
````
gn gen out/Shared --ide=vs --target_cpu="x64" --args="is_component_build=true is_debug=false is_clang=false"
````
It's important that you build using MSVS and **not** clang, as otherwise you will potentially get linking errors.To build the project run:
````
ninja -C out/Shared
````In case python wasn't found:
- Use `where python` to get the location of your python installation
- Repoint it by running e.g. `npm config set python C:\depot_tools\python.bat`### Linux
Follow dawn's initial setup instructions, but instead of the standard build, do the following:
To generate the project as a shared library:
````
gn gen out/Shared --target_cpu="x64" --args="is_component_build=true is_debug=false is_clang=true"
````To build the project run:
````
ninja -C out/Shared
````### MacOS
Follow dawn's initial setup instructions, but instead of the standard build, do the following:
To generate the project as a shared library:
````
gn gen out/Shared --target_cpu="x64" --args="is_component_build=true is_debug=false is_clang=true"
````To build the project run:
````
ninja -C out/Shared
````## Examples
````
cd examples & cd ..
node --experimental-modules examples/interactive-triangle.mjs
````## TODOs
- Add CTS
- Remove libshaderc from build?