vulkano/shader-parser/examples/example.rs

23 lines
436 B
Rust
Raw Normal View History

extern crate glsl_to_spirv;
2016-01-31 10:36:16 +00:00
extern crate shader_parser;
fn main() {
let shader = r#"
#version 450
2016-01-31 12:34:19 +00:00
uniform sampler2D u_texture;
2016-01-31 12:34:19 +00:00
in vec2 v_texcoords;
out vec4 f_color;
void main() {
2016-01-31 12:34:19 +00:00
f_color = texture(u_texture, v_texcoords);
}
"#;
let content = glsl_to_spirv::compile(Some((shader, glsl_to_spirv::ShaderType::Fragment))).unwrap();
let output = shader_parser::reflect(content).unwrap();
2016-01-31 10:36:16 +00:00
println!("{}", output);
}