Directxshader compiler mac编译
1/前置条件
Please make sure you have the following resources before building:
2/clone源码
git clone --recursive GitHub - microsoft/DirectXShaderCompiler: This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang. 注意需要递归clone依赖库
3/编译
cmake ../ -G Ninja -DCMAKE_BUILD_TYPE=Release -C ../cmake/caches/PredefinedParams.cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
ninja 编译源码
4/编译后结果
<dxc-build-dir>/bin/dxc
5 使用
./bin/dxc -help
./bin/dxc -T <target> -E <entry-point-name> <input-hlsl-file>