Create metallib.sh

This commit is contained in:
Taylor Holliday 2022-02-10 08:30:05 -08:00
parent b514538371
commit f95c7fce04
1 changed files with 10 additions and 0 deletions

10
metallib.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/zsh
set -euo pipefail
# This script builds a metallib suitable for debugging. Unfortunately, SPM doesn't support compiling metal with debug symbols on.
# See https://forums.swift.org/t/cant-profile-metal-shaders-within-a-package/49607
export MTL_ENABLE_DEBUG_INFO=INCLUDE_SOURCE
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
xcrun --sdk macosx metal -target air64-apple-macos12.1 -ffast-math -gline-tables-only -MO -o vger.metallib Sources/vger/vger.metal