MetalShaderTools
Tools and samples for understanding Apple's Metal shading language and its LLVM Bitcode shader files
Install / Use
/learn @zhuowei/MetalShaderToolsREADME
Tools for examining Apple's Metal shaders.
Contents
- unmetallib.py: extracts .metallib files to .air files.
- sampleshader/: contains:
- a Metal shader from Apple's HelloTriangle project
- the compiled metallib using Xcode 9.3's metal compiler
- the .air files recompiled to x86_64 and arm64 assembly using LLVM 6.0.0 to show that Metal shaders are valid LLVM Bitcode and can be processed using normal LLVM tools.
Other Metal projects you might find useful
- https://github.com/gzorin/LLAIR - wrapper around Metal compiler to make examining bitcode easier
- https://github.com/a2flo/floor - C++ to Metal compiler with patched LLVM to generate .air files
License
My code (unmetallib.py, sampleshader/*.sh) is under the MIT license.
sampleshader/AAPLShaders.metal and sampleshader/AAPLShaderTypes.h are taken from Apple's HelloTriangle project. Their license can be found in sampleshader/AAPLShaders_LICENSE.txt (also MIT license)
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
