Print formatted GLSL compile error messages

This commit is contained in:
Alexander Dmitriev 2016-10-04 19:52:16 +02:00
parent 77c5bd8001
commit 0cb7e3e300

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();
}