aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/error.rs
blob: 7c9abd41f0ef34c6148b7e894a5529b2d8769aba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Error types

use super::draw::target::TargetChainCreationError;
use thiserror::Error;

/// An error encountered creating a rendering context.
#[derive(Debug)]
pub enum CreationError {
    TargetChainCreationError(TargetChainCreationError),
    WindowError,
    BadSurface,

    DeviceError(hal::device::CreationError),

    OutOfMemoryError,

    SyncObjectError,

    NoShaderC,
    ShaderCError(shaderc::Error),
    ShaderModuleFailed(hal::device::ShaderError),
    RenderPassError,
    PipelineError(hal::pso::CreationError),
    BufferError(hal::buffer::CreationError),
    BufferNoMemory,

    SwapchainError,
    ImageViewError,

    BadDataError,
}

/// An error encountered when rendering.
/// Usually this is out of memory or something happened to the device/surface.
/// You'll likely need to exit or create a new context.
#[derive(Debug, Clone)]
pub enum FrameError {}

#[derive(Error, Debug)]
pub enum LockPoisoned {
    #[error("Device lock poisoned")]
    Device,

    #[error("Map lock poisoned")]
    Map,

    #[error("Queue lock poisoned")]
    Queue,
}