Rust build.rs integration for glslc.
Based on buildkit, the world's tiniest buildsystem, this script lets you compile GLSL shaders to SPIR-V with cargo as part of your Rust build process.
This crate might be compared to shaderc. Differences include:
- No support for compiling shaderc from source; you must have it installed already. On the plus side, this means it's fast to use.
- Support for buildkit features, such as skipping compiles if no files changed.
- Free for noncommercial and "small commercial" use.
This crate provides separate compilers for vertex (VertexCompiler
) and fragment (FragmentCompiler
) shaders. Other options might be investigated in the future.
Usage
- Install glslc to your path
- In
build.rs
, callbuild_rs
. This will internally callCompileSystem::build_rs
on all supported compiler types.