diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-07-04 16:49:31 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-07-04 16:49:31 -0700 |
| commit | aea6d8b310dede44211fcf994f8ddb42df076d91 (patch) | |
| tree | a0df2bf481b3fbccd66648634220fed411776fab /src/error.rs | |
| parent | 8eb7bc2dcab860231c26bfe14d4c780449052da3 (diff) | |
load compiled SPIR-V bytecode (yay)
no way to build it except by hand, as-yet. the tutorial doesn't cover that, we'll need to circle back and write a build.rs Force-Push: yes Change-Id: I2b489381f95b4b7505862caa236dea1c60cd9c1a
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 14 |
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); |