Merge pull request #297 from alexd2580/format-glsl-errors

Print formatted GLSL compile error messages
This commit is contained in:
tomaka 2016-10-04 20:30:06 +02:00 committed by GitHub
commit d81031696a

View File

@ -47,7 +47,10 @@ pub fn build_glsl_shaders<'a, I>(shaders: I)
let mut file_output = File::create(&dest.join("shaders").join(shader))
.expect("failed to open shader output");
let content = glsl_to_spirv::compile(&shader_content, ty).unwrap();
let content = match glsl_to_spirv::compile(&shader_content, ty) {
Ok(compiled) => compiled,
Err(message) => panic!("{}\nfailed to compile shader", message),
};
let output = reflect("Shader", content).unwrap();
write!(file_output, "{}", output).unwrap();
}