GithubHelp home page GithubHelp logo

pjoe / webgpu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maierfelix/webgpu

0.0 2.0 0.0 630 MB

WebGPU for Node [WIP]

License: MIT License

JavaScript 1.86% Python 1.32% C++ 80.09% C 7.33% HTML 0.62% Objective-C 0.59% Objective-C++ 0.58% Makefile 7.60%

webgpu's Introduction

webgpu

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 ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ X ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌

Building

You have to build 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

If you do not have Vulkan installed, point to dawn Vulkan libraries for your system, eg:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your-path-to-dawn/build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu

OR minimally install libvulkan1 package for your system, eg:

sudo apt install libvulkan1

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?
  • Research for a better Error callback system

webgpu's People

Contributors

maierfelix avatar dcerisano avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.