polyscope_render/
error.rs1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum RenderError {
8 #[error("failed to create graphics adapter")]
10 AdapterCreationFailed,
11
12 #[error("failed to create graphics device: {0}")]
14 DeviceCreationFailed(#[from] wgpu::RequestDeviceError),
15
16 #[error("failed to create surface: {0}")]
18 SurfaceCreationFailed(#[from] wgpu::CreateSurfaceError),
19
20 #[error("surface configuration failed")]
22 SurfaceConfigurationFailed,
23
24 #[error("shader compilation failed: {0}")]
26 ShaderCompilationFailed(String),
27
28 #[error("pipeline creation failed: {0}")]
30 PipelineCreationFailed(String),
31
32 #[error("buffer creation failed: {0}")]
34 BufferCreationFailed(String),
35
36 #[error("texture creation failed: {0}")]
38 TextureCreationFailed(String),
39
40 #[error("surface lost")]
42 SurfaceLost,
43
44 #[error("surface outdated")]
46 SurfaceOutdated,
47
48 #[error("out of memory")]
50 OutOfMemory,
51
52 #[error("timeout waiting for GPU")]
54 Timeout,
55}
56
57pub type RenderResult<T> = std::result::Result<T, RenderError>;