- Install
shader-sdk, on Windows you should run these commands inDeveloper Command Prompt for VS
git clone https://github.com/BeamMW/shader-sdk.git
cd shader-sdkOn Linux and MacOS
./shade initOn Windows
shade init- Create envoronment valiable
BEAM_SHADER_SDK=<path to shader-sdk> - Create envoronment valiable
WASI_SDK_PREFIX=<path to wasi-sdk>.wasi-sdkshould exist inshader-sdkfolder after./shade initcommand completion - Generate new shader project
mkdir new_project
cd new_project
<BEAM_SHADER_SDK>/shade create_project <project_name>This script generate new project files where <project_name> is used for namespace, also it verifies that it compiles
- Build project
On Linux and MacOS
cmake -G "Ninja"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=$WASI_SDK_PREFIX/share/cmake/wasi-sdk.cmake
-DCMAKE_SYSROOT=$WASI_SDK_PREFIX/share/wasi-sysroot
-DWASI_SDK_PREFIX=$WASI_SDK_PREFIX
-DCMAKE_CXX_COMPILER_FORCED=True
-DCMAKE_C_COMPILER_FORCED=True
.
makeOn Window
- Open
new_projectfolder in VS as a CMake project. - Choose configuration
wasm32-Release - Build