DirectXShaderCompiler mac编译

郎羽
2023-12-01

Directxshader compiler mac编译

1/前置条件

Please make sure you have the following resources before building:

  • Git
  • Python. Version 3.x is required.
  • Ninja (Optional CMake generator)
  • Either of gcc/g++ or clang/clang++ compilers. Minimum supported version:
    • GCC version 5.5 or higher.
    • Clang version 3.8 or higher.

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>

 类似资料: