From 0cb7e3e30029be20d1efa14ef417887434ff3a76 Mon Sep 17 00:00:00 2001 From: Alexander Dmitriev Date: Tue, 4 Oct 2016 19:52:16 +0200 Subject: [PATCH] Print formatted GLSL compile error messages --- vulkano-shaders/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vulkano-shaders/src/lib.rs b/vulkano-shaders/src/lib.rs index b0805238..93ac85c4 100644 --- a/vulkano-shaders/src/lib.rs +++ b/vulkano-shaders/src/lib.rs @@ -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(); }