2016-01-31 12:18:58 +00:00
|
|
|
extern crate glsl_to_spirv;
|
2016-01-31 10:36:16 +00:00
|
|
|
extern crate shader_parser;
|
|
|
|
|
|
|
|
fn main() {
|
2016-01-31 12:18:58 +00:00
|
|
|
let shader = r#"
|
|
|
|
#version 450
|
|
|
|
|
2016-01-31 12:34:19 +00:00
|
|
|
uniform sampler2D u_texture;
|
2016-01-31 12:18:58 +00:00
|
|
|
|
2016-01-31 12:34:19 +00:00
|
|
|
in vec2 v_texcoords;
|
|
|
|
out vec4 f_color;
|
2016-01-31 12:18:58 +00:00
|
|
|
|
|
|
|
void main() {
|
2016-01-31 12:34:19 +00:00
|
|
|
f_color = texture(u_texture, v_texcoords);
|
2016-01-31 12:18:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
"#;
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|