summary refs log tree commit diff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 39d52b8..f3f1ca9 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -76,6 +76,20 @@ impl From<vulkanalia::vk::ErrorCode> for Error {
   }
 }
 
+impl From<vulkanalia::bytecode::BytecodeError> for Error {
+  fn from(e: vulkanalia::bytecode::BytecodeError) -> Self {
+    Error {
+      message: match e {
+        vulkanalia::bytecode::BytecodeError::Alloc =>
+            "Unable to allocate buffer for SPIR-V bytecode.".to_string(),
+        vulkanalia::bytecode::BytecodeError::Length(length) =>
+            format!("Compiled SPIR-V bytecode has length {}, \
+                    which means it's corrupt.", length)
+      }
+    }
+  }
+}
+
 pub fn ignore_errors(mut body: impl FnMut() -> Result<()>) -> () {
   if let Err(e) = body() {
     eprintln!("Error: {}", e);