Files
netris-nestri/crates/nespyro/src/error.rs
T
cf46bf4d12 feat: pyrowave support (#354)
At this point, why not..

Calling it `nespyro` since it's slightly modified, uses slang shader
language instead, along other things..

---------

Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 23:53:19 +03:00

35 lines
1.0 KiB
Rust

use ash::vk;
use thiserror::Error;
use crate::bitstream::BitstreamError;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error)]
pub enum Error {
#[error("Vulkan: {0}")]
Vulkan(vk::Result),
/// The device lacks what the codec needs; every missing piece is named.
#[error("device cannot run nespyro, missing: {}", .0.join(", "))]
Unsupported(Vec<String>),
#[error("invalid configuration: {0}")]
Config(String),
#[error(transparent)]
Bitstream(#[from] BitstreamError),
/// Every output slot is held by the caller; drop a frame and try again.
#[error("every output slot is still held")]
Busy,
/// The encoder was shut down before the frame was read back.
#[error("encoder shut down before the frame was read back")]
Cancelled,
/// Nothing to decode: no start-of-frame header yet, or already decoded.
#[error("nothing to decode: {0}")]
NotReady(&'static str),
}
impl From<vk::Result> for Error {
fn from(r: vk::Result) -> Self {
Error::Vulkan(r)
}
}