- Checkout the relevant branch (currently
pbfix_mango) - Make sure you have xcode, dev tools, and metal tools installed (i.e.
xcodebuild -downloadComponent MetalToolchain)
Currently only dawn is known to work with this setup, so you need to build and install it somewhere. A script in lib can do this:
./build_dawn.sh getdeps ~/dawnbuild
./build_dawn.sh build ~/dawnbuild Release
Then take a nap until it completes building.
You will also need to build SDL2. There is a submodule configurable from the git repository which can be built as follows:
git submodule init
git submodule update
cd lib/SDL2
./gen_mac_libs.sh
Currently only cmake has the required config parameters set to to build:
cd buildFiles
mkdir buildosx && cd buildosx
cmake -G Xcode -DWGPU_DAWN_BUILD_PATH=<dawn folder>/out/Release cmake -DUSE_EXT_SDL2=1 ..
Then build within XCode as usual. You can omit -DUSE_EXT_SDL2=1 if you instead wish to use a system provided version of SDL2.
When running, make sure to copy all the shaders to shaders/ in the example folder i.e.:
mkdir example/shaders
cp ./engine/dgl/pipeline/webgpu/*.wgsl example/shaders/