pub enum MeshPoolError {
PoolExhausted {
pool: &'static str,
requested: u32,
largest_free: u32,
total_free: u32,
capacity: u32,
},
VertexCapacityTooLarge {
capacity: u32,
},
MeshTableFull {
capacity: u32,
in_use: u32,
},
EmptyReservation,
EmptyMesh {
vertices: u32,
indices: u32,
},
VertexStrideMismatch {
bytes: usize,
},
NotResident {
handle: MeshHandle,
},
UploadTimedOut {
timeout: Duration,
},
Hal(HalError),
}Expand description
What a MeshPool refuses to do.
Variants§
PoolExhausted
No single free block is large enough.
largest_free well below total_free is fragmentation — see the
module docs on why the pool does not compact to fix it. A
total_free below requested is a pool that is simply too small.
Fields
VertexCapacityTooLarge
A vertex capacity no draw could address.
draw_indexed takes its base vertex signed — Vulkan, D3D12 and
WebGPU all do — so a pool larger than that could hand out a base the
draw cannot express. Refused at creation, which is what lets
MeshRange::base_vertex be an ordinary count everywhere else.
MeshTableFull
Every mesh-table entry is spoken for.
The table is one entry per mesh the pool can hold at once, and it is
fixed by MeshPoolDesc::mesh_capacity for the reason every other
capacity here is: the buffer is created once and bound into every group
that names it.
Fields
EmptyReservation
A reservation of no vertices, which has no address to hand back.
Its own variant rather than EmptyMesh: a
reserve_vertices caller has no indices
to have got wrong, and a message naming them would send the reader
looking for a mistake that is not there.
EmptyMesh
A mesh with no vertices or no indices.
VertexStrideMismatch
The vertex bytes are not a whole number of vertices.
NotResident
A mesh has no range to draw: unknown handle, freed handle, or an upload that has not completed.
Fields
handle: MeshHandleThe handle that resolved to nothing.
UploadTimedOut
The transfers did not complete within UPLOAD_TIMEOUT.
Hal(HalError)
Anything the seam refused.
Trait Implementations§
Source§impl Debug for MeshPoolError
impl Debug for MeshPoolError
Source§impl Display for MeshPoolError
impl Display for MeshPoolError
Source§impl Error for MeshPoolError
impl Error for MeshPoolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<HalError> for MeshPoolError
impl From<HalError> for MeshPoolError
Source§impl From<MeshPoolError> for HalError
Flattens a pool error into the seam’s, for callers whose constructors are
already Result<_, HalError>.
impl From<MeshPoolError> for HalError
Flattens a pool error into the seam’s, for callers whose constructors are
already Result<_, HalError>.
The seam has no vocabulary for “this pool is fragmented”, so everything that
is not already a HalError arrives as
Backend — which renders verbatim, so the message
naming the numbers survives. Callers that want to match on exhaustion take
MeshPoolError instead.