include-glsl 0.2.0

Compile a GLSL shader into SPIR-V and include it as a u32 array.
1
2
3
4
5
6
7
8
9
use include_glsl::include_glsl;

static FRAG: &[u32] = include_glsl!("hello.frag");
static VERT: &[u32] = include_glsl!("hello.vert");

fn main() {
    println!("The fragment shader is {} words long.", FRAG.len());
    println!("The vertex shader is {} words long.", VERT.len());
}