GLSL to WGSL package for Web and Node
Web和Node的GLSL到WGSL转换工具包
prerequisites
- emscripten
- depot_tools
- python
- cmake
- ninja-build(optional)
- init submodule
git submodule update --init --depth 1
- fetch dawn dependencies(in dependencies/dawn)
cp scripts/standalone.gclient .gclient gclient sync --no-history
- apply patches(in repo root)
git apply patches/dawn.patch
- cmake(create build directory under root,use ninja for example,use make will work too)
# FOR WEB emcmake cmake -DCMAKE_BUILD_TYPE=RELEASE -G Ninja ../ # FOR NODEJS emcmake cmake -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_ENVIRONMENT_NODE=ON -G Ninja ../
- build(16 cpus for example)
ninja shader_converter -j 16
准备好以下相关工具
- emscripten
- depot_tools
- python
- cmake
- ninja-build(可选)
- 初始化submodule
git submodule update --init --depth 1
- 拉取dawn依赖包(dependencies/dawn目录下)
cp scripts/standalone.gclient .gclient gclient sync --no-history
- 应用补丁(仓库根目录)
git apply patches/dawn.patch
- 执行cmake(自行创建build目录,此处使用Ninja进行构建,也可以使用make)
# Web环境 emcmake cmake -DCMAKE_BUILD_TYPE=RELEASE -G Ninja ../ # Node环境 emcmake cmake -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_ENVIRONMENT_NODE=ON -G Ninja ../
- 执行构建(以16核为例)
ninja shader_converter -j 16