What problem does it solve?
It provides an experimental alternative Vulkan codegen path that lowers LuisaCompute AST functions to LLVM IR and emits SPIR-V modules, while enforcing a fail-closed runtime-interface boundary so unsupported kernels are rejected instead of silently miscompiled.
Core Features & Use Cases
- AST-to-SPIR-V compilation: Lowers Luisa AST kernels through LLVM IR to a
spirv64-unknown-vulkan1.2 module via the LLVM-free public facade lc::llvm_codegen::compile_spirv.
- Fail-closed resource preflight:
validate_llvm_vulkan_resource_model rejects kernel arguments, textures, bindless arrays, acceleration structures, and shader printing before lowering, so only no-argument, no-print compute kernels compile.
- Build integration: Guides CMake (
luisa-compute-spirv-llvm) and XMake (lc-spirv-llvm) configuration with component-aware LLVM discovery, ABI checks, and private LLVM headers.
- Use Case: When extending the backend to support a new AST operation, follow the documented pipeline: implement LLVM IR lowering, extend the property preflight, validate the Vulkan binding shape, and add an end-to-end SPIR-V validator test.
Quick Start
Compile a no-argument compute kernel through the public facade and validate the returned SPIR-V module with SPIRV-Tools under SPV_ENV_VULKAN_1_2.