Skip to main content

MeshPoolError

Enum MeshPoolError 

Source
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

§pool: &'static str

"vertex" or "index".

§requested: u32

What the allocation asked for, in elements.

§largest_free: u32

The largest single run the free list could offer.

§total_free: u32

Everything free, summed across blocks.

§capacity: u32

The pool’s fixed capacity, in elements.

§

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.

Fields

§capacity: u32

What was asked for.

§

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

§capacity: u32

The table’s fixed capacity.

§in_use: u32

Entries that cannot be handed out — live meshes, plus any slot permanently withdrawn by generation exhaustion.

§

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.

Fields

§vertices: u32

Vertices offered.

§indices: u32

Indices offered.

§

VertexStrideMismatch

The vertex bytes are not a whole number of vertices.

Fields

§bytes: usize

What the caller offered.

§

NotResident

A mesh has no range to draw: unknown handle, freed handle, or an upload that has not completed.

Fields

§handle: MeshHandle

The handle that resolved to nothing.

§

UploadTimedOut

The transfers did not complete within UPLOAD_TIMEOUT.

Fields

§timeout: Duration

How long the wait was given.

§

Hal(HalError)

Anything the seam refused.

Trait Implementations§

Source§

impl Debug for MeshPoolError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MeshPoolError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for MeshPoolError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<HalError> for MeshPoolError

Source§

fn from(source: HalError) -> Self

Converts to this type from the input type.
Source§

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.

Source§

fn from(error: MeshPoolError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.