Skip to content

Instantly share code, notes, and snippets.

@jamesu
Last active December 29, 2025 22:40
Show Gist options
  • Select an option

  • Save jamesu/626681c220ee1a782577d15e83a9d2b8 to your computer and use it in GitHub Desktop.

Select an option

Save jamesu/626681c220ee1a782577d15e83a9d2b8 to your computer and use it in GitHub Desktop.
Building tgemit on OSX using SDL2

Building tgemit on OSX using SDL2

  • 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/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment