Cross-platform shader compiler and runtime library. Compiles HLSL shaders to multiple GPU backends (DXIL, DXBC, MSL, SPIR-V) and packages them with reflection metadata into a single binary format for runtime loading.
Built on SDL_shadercross for shader compilation and cross-compilation.
- Multi-backend compilation: Single HLSL source compiles to DXIL, DXBC, Metal, and SPIR-V
- Reflection metadata: Extracts input/output bindings, resource counts, thread dimensions
- Binary format: Compact
.nshaderfiles contain all backends + metadata - SDL3 GPU integration: Optional helpers for creating
SDL_GPUShaderandSDL_GPUComputePipeline - CLI tool: Compile, inspect, and extract shaders from command line
- CMake 3.19+
- C11 compiler
- C++20 compiler (tests only)
- SDL3 (fetched automatically if not found)
- SDL_shadercross (fetched automatically if not found)
| Option | Default | Description |
|---|---|---|
NSHADER_BUILD_SHARED |
OFF | Build as shared library |
NSHADER_BUILD_TESTS |
ON | Build test suite |
NSHADER_BUILD_CLI |
ON | Build CLI tool |
See docs for comprehensive API documentation and usage patterns.
MIT License - see LICENSE