I’m trying to build an application and would like to load SPIR-V binary files, and JIT Compile it via LLVM to run shaders on CPU.
I would like to use a library (or possibly build my own) that parses SPIR-V and JIT compiles via LLVM API. Then the library can provide C++ interface to compiled data in memory, and I can access resources or call shader methods via the interface.
The reason I’m looking for a C++ library is that I want the LLVM part isolated from my applications.
Steps In My Mind
- Load/Parse SPIR-V binary files.
- Generate LLVM IR with LLVM API to JIT Compile shaders in memory via the library.
- Use a C++ interface to access resources in memory and bind shader methods to call from an application.
Is there a C++ library or code example that I can use for this? Or could you please guide me by providing steps to achieve this in the shortest path?