DirectXShaderCompiler mac编译
Posted 周旭光
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DirectXShaderCompiler mac编译相关的知识,希望对你有一定的参考价值。
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:
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>
以上是关于DirectXShaderCompiler mac编译的主要内容,如果未能解决你的问题,请参考以下文章