molgfx_render/engine/chunk_placement/errors.rs
1use thiserror::Error;
2
3/// Current draw eligibility of one declarative placement.
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum ChunkPlacementStatus {
6 /// Its exact generation is resident and enters the shared indirect batch.
7 Resident,
8 /// The placement remains declared but its ticket is absent or not ready.
9 NotResident,
10 /// No placement with this identity is declared.
11 Missing,
12}
13
14/// Why a declarative placement set could not be accepted.
15#[derive(Clone, Copy, Debug, Error, PartialEq, Eq)]
16pub enum ChunkPlacementError {
17 /// A point diameter was zero, negative or non-finite.
18 #[error("point diameter must be finite and positive")]
19 InvalidPointDiameter,
20 /// A radius scale was zero, negative or non-finite.
21 #[error("spacefill radius scale must be finite and positive")]
22 InvalidRadiusScale,
23 /// A bond radius was zero, negative or non-finite.
24 #[error("bond radius must be finite and positive")]
25 InvalidBondRadius,
26 /// A relation width or opacity was outside its finite visual range.
27 #[error("relation style must have positive finite width and bounded opacity")]
28 InvalidRelationStyle,
29 /// A paged relation visual requested an unsupported output channel.
30 #[error("paged visual program is incompatible with relation glyphs")]
31 InvalidRelationVisual,
32 /// A transform contains a non-finite component.
33 #[error("chunk placement transform must be finite")]
34 NonFiniteTransform,
35 /// Two placements reused the same caller identity.
36 #[error("chunk placement identity {id} is duplicated")]
37 DuplicateIdentity {
38 /// Reused identity.
39 id: u64,
40 },
41 /// The fixed placement working-set capacity was exhausted.
42 #[error("chunk placement capacity {capacity} is exhausted")]
43 Capacity {
44 /// Configured maximum resident placements.
45 capacity: usize,
46 },
47 /// A trajectory interpolation factor was not in the closed unit interval.
48 #[error("trajectory interpolation must be finite and between zero and one")]
49 InvalidInterpolation,
50}