https://github.com/xenoatom/xenoatom.shadercompiler
Provides a .NET library, a tool executable and an integration of shaderc compiler into MSBuild for compiling all your GLSL/HLSL files to SPIR-V.
https://github.com/xenoatom/xenoatom.shadercompiler
csharp dotnet glsl hlsl shaderc spir-v vulkan
Last synced: 6 months ago
JSON representation
Provides a .NET library, a tool executable and an integration of shaderc compiler into MSBuild for compiling all your GLSL/HLSL files to SPIR-V.
- Host: GitHub
- URL: https://github.com/xenoatom/xenoatom.shadercompiler
- Owner: XenoAtom
- License: bsd-2-clause
- Created: 2024-06-17T20:34:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-23T10:15:11.000Z (7 months ago)
- Last Synced: 2025-04-05T04:23:24.899Z (6 months ago)
- Topics: csharp, dotnet, glsl, hlsl, shaderc, spir-v, vulkan
- Language: C#
- Homepage:
- Size: 740 KB
- Stars: 25
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: license.txt
Awesome Lists containing this project
README
# XenoAtom.ShaderCompiler [](https://github.com/XenoAtom/XenoAtom.ShaderCompiler/actions/workflows/ci.yml)
This project provides:
- A library `XenoAtom.ShaderCompiler` that exposes higher-level integration of [shaderc](https://github.com/google/shaderc) to compile HLSL/GLSL shaders. [](https://www.nuget.org/packages/XenoAtom.ShaderCompiler/)
- A tool `dotnet-shaderc` the equivalent of [`glslc`](https://github.com/google/shaderc/tree/main/glslc) that can be installed on any machine that has the .NET 8 SDK [](https://www.nuget.org/packages/dotnet-shaderc/)
- A MSBuild integration via `XenoAtom.ShaderCompiler.Build` that allows to compile shaders to SPIR-V binary files, embed them directly in C# (via a built-in Source Generator) or generates `tar`/`tar.gz` files. [](https://www.nuget.org/packages/XenoAtom.ShaderCompiler.Build/)## ✨ Features
- Supports most features of [shaderc](https://github.com/google/shaderc).
- Support for include directories.
- **Multithreaded shader compiler**.
- `dotnet-shaderc` is a .NET Tool equivalent of [`glslc`](https://github.com/google/shaderc/tree/main/glslc) that can be installed on any machine that has the .NET 8 SDK
- The package `XenoAtom.ShaderCompiler.Build` allows to integrate in your C# or any MSBuild projects the compilation of HLSL/GLSL shaders.
- **C# source generator** supports embedding SPIR-V binary returned as `ReadOnlySpan` (Default mode for C# projects).
- Can generate `tar` / `tar.gz` files to collect all compiled shaders.
- Can copy SPIR-V files as-is to the output folder shipped with your library/app.
- **Incremental compiler** that detects includes and dependencies to only compile relevant changes.## 📖 User Guide
For more details on how to use XenoAtom.ShaderCompiler, please visit the [user guide](https://github.com/XenoAtom/XenoAtom.ShaderCompiler/blob/main/doc/readme.md).
## 🪪 License
This software is released under the [BSD-2-Clause license](https://opensource.org/licenses/BSD-2-Clause).
## 🤗 Author
Alexandre Mutel aka [xoofx](https://xoofx.github.io).