A cross-platform .NET 8.0 wrapper for Khronos Group's SPIR-V cross compiler, written in C#.
For a brief showcase of how SPIRV-Cross.NET works, check the Example folder. At the moment, the object structure maps relatively close to SPIRV-Cross's C++ API, and the library's documentation can generally be used in most cases. However, if there is not a direct mapping for a given field, property, or function, please consult the source files in Source/Managed/.. for more info.
To facilitate cross-platform releases, the native SPIRV-Cross library is built using zig instead of CMake/GN. As Zig's compiler supports cross-compilation out of the box, it allows SPIRV-Cross to build easily from most desktop platforms, for most platforms. The libraries produced by building this repository are what SPIRV-Cross.NET uses in its releases.
To build native libraries, run the BuildNative.cs
file inside the Native folder, specicying your target architecture [x64, arm64, all] with -A and your target platform [windows, linux, macos, all] with -P.
Native build requirements:
- Zig compiler version present on your
PATH
of at least version 0.14.0+. You can get the compiler from Zig's download page or from a package manager
Pre-built binaries are bundled in the NuGet package for the following operating systems:
- Windows x64
- Windows arm64
- OSX x64
- OSX arm64
- Linux x64
- Linux arm64