https://github.com/sinnwrig/spirv-cross.net
.NET wrapper for SPIRV-Cross written in C#
https://github.com/sinnwrig/spirv-cross.net
Last synced: 3 months ago
JSON representation
.NET wrapper for SPIRV-Cross written in C#
- Host: GitHub
- URL: https://github.com/sinnwrig/spirv-cross.net
- Owner: sinnwrig
- License: mit
- Created: 2024-07-25T02:59:13.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-31T18:28:14.000Z (7 months ago)
- Last Synced: 2025-01-22T09:33:47.087Z (4 months ago)
- Language: C#
- Size: 144 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SPIRV-Cross.NET: cross-platform C# wrapper for SPIRV-Cross
A cross-platform .NET 8.0 wrapper for Khronos Group's SPIR-V cross compiler, written in C#.
[](https://www.nuget.org/packages/SPIRV-Cross.NET)
# Usage
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](https://github.com/KhronosGroup/SPIRV-Cross/wiki/Reflection-API-user-guide) 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.
# Native Details
To facilitate cross-platform releases, the native SPIRV-Cross library is [built using zig](https://github.com/sinnwrig/SPIRV-Cross-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.
## Building Native Libraries
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](https://ziglang.org/download/) or [from a package manager](https://github.com/ziglang/zig/wiki/Install-Zig-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