56 lines
1.3 KiB
Markdown
56 lines
1.3 KiB
Markdown
# lume
|
|
|
|
lume is a compiler that converts SPIR-V binaries to MLIR and then to LLVM IR. This enables cross compilation of SPIR-V shaders to various target architectures through the LLVM toolchain
|
|
|
|
## Building
|
|
|
|
### Prerequisites
|
|
|
|
- CMake 3.20 or higher
|
|
- LLVM (w/ MLIR support)
|
|
- C++17 compatible compiler
|
|
|
|
### Build
|
|
|
|
```bash
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DLLVM_DIR=/path/to/llvm/build/lib/cmake/llvm \
|
|
-DMLIR_DIR=/path/to/mlir/build/lib/cmake/mlir
|
|
make
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
lume input.spv -o output.mlir
|
|
lume input.spv --dump-mlir
|
|
lume input.spv --dump-all
|
|
lume - -o output.mlir
|
|
```
|
|
|
|
<h2>Options</h2>
|
|
|
|
<ul>
|
|
<li>
|
|
<strong>Input file</strong><br>
|
|
<code><input file></code><br>
|
|
<span style="margin-left:2em;">Input SPIR-V binary file (use <code>-</code> for stdin)</span>
|
|
</li>
|
|
<li>
|
|
<strong>Output file</strong><br>
|
|
<code>-o <output file></code><br>
|
|
<span style="margin-left:2em;">Specify output file (default: stdout)</span>
|
|
</li>
|
|
<li>
|
|
<strong>SPIR-V MLIR Dump</strong><br>
|
|
<code>--dump-mlir</code><br>
|
|
<span style="margin-left:2em;">Dump the SPIR-V MLIR dialect</span>
|
|
</li>
|
|
<li>
|
|
<strong>Full Dump</strong><br>
|
|
<code>--dump-all</code><br>
|
|
<span style="margin-left:2em;">Dump all dialects and LLVM IR</span>
|
|
</li>
|
|
</ul>
|