#[non_exhaustive]pub enum ViewportError {
Show 26 variants
EmptyMesh {
positions: usize,
indices: usize,
},
MeshLengthMismatch {
positions: usize,
normals: usize,
},
OverrideBufferVertexCountMismatch {
mesh_id: usize,
mesh_vertices: usize,
override_vertices: usize,
},
StaleHandle {
index: usize,
count: usize,
},
InvalidVertexIndex {
vertex_index: u32,
vertex_count: usize,
},
VolumeDataLengthMismatch {
actual: usize,
expected: usize,
dims: [u32; 3],
},
InvalidTextureData {
expected: usize,
actual: usize,
},
UnsupportedTextureFormat {
format: TextureFormat,
},
CompressedTextureNotBlockAligned {
width: u32,
height: u32,
block_width: u32,
block_height: u32,
},
InvalidCompressedTextureData {
level: u32,
expected: usize,
actual: usize,
},
SlotEmpty {
index: usize,
},
AttributeNotFound {
mesh_id: usize,
name: String,
},
AttributeLengthMismatch {
expected: usize,
got: usize,
},
McBufferTooLarge {
buffer: &'static str,
needed: u64,
limit: u64,
},
InvalidGaussianSplatData {
reason: &'static str,
},
JobWorkerLost {
reason: &'static str,
},
JobNotReady,
JobResultMissing {
reason: &'static str,
},
DeformSlotsExhausted {
max: usize,
},
DeformNameTaken {
name: String,
},
DeformShaderInvalid {
reason: String,
},
LodGroupEmpty,
LodLevelCountMismatch {
meshes: usize,
thresholds: usize,
},
LodThresholdsNotDescending {
level: usize,
},
LodLevelIncompatible {
level: usize,
reason: String,
},
LodGroupNotFound {
index: usize,
},
}Expand description
Errors that can occur during mesh upload and manipulation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyMesh
Mesh data has empty positions or indices.
MeshLengthMismatch
Positions and normals arrays have different lengths.
OverrideBufferVertexCountMismatch
A position/normal override buffer was bound to a mesh whose vertex count differs from the buffer’s. The shader indexes the override per mesh vertex, so a smaller buffer reads out of bounds and a different count silently scrambles the geometry.
Fields
StaleHandle
A handle does not resolve to a live resource: its slot was freed, reused at a newer generation, or its index is out of range for the store.
Fields
InvalidVertexIndex
An index buffer entry references a vertex that does not exist.
VolumeDataLengthMismatch
Volume scalar data length does not match the declared grid dimensions.
Fields
InvalidTextureData
Texture RGBA data has an unexpected size.
Fields
UnsupportedTextureFormat
A compressed-texture upload requested a format the device cannot sample, or a format that is not block-compressed.
The device check reads the format’s required wgpu feature (for example
TEXTURE_COMPRESSION_BC, _ASTC, or _ETC2). When this is returned for
a hardware reason, the caller should fall back to upload_texture /
upload_normal_map or ship a variant the device supports.
Fields
format: TextureFormatThe format that was rejected.
CompressedTextureNotBlockAligned
A compressed-texture upload had base dimensions that are not a multiple of the format’s block size. Block-compressed textures must be created with block-aligned dimensions; pad the image (and adjust UVs) or upload it uncompressed.
Fields
InvalidCompressedTextureData
A mip level of a compressed-texture upload had the wrong byte length for its block-packed dimensions.
Fields
SlotEmpty
Attempted to access or replace a slot that is empty (its resource was previously freed).
AttributeNotFound
Named scalar attribute not found on the given mesh.
Fields
AttributeLengthMismatch
Attribute data length does not match the existing buffer.
replace_attribute requires the same vertex count as the original upload.
Fields
McBufferTooLarge
A buffer required for GPU marching cubes upload exceeds the device’s
max_buffer_size limit. The caller should fall back to CPU marching cubes.
Fields
InvalidGaussianSplatData
Gaussian splat data is malformed or empty.
JobWorkerLost
A background upload worker panicked or dropped its channel before sending a result.
JobNotReady
upload_result_* was called before the corresponding job reached the
Ready state. Poll upload_status and retry on the next frame.
JobResultMissing
upload_result_* was called with a JobId that does not belong to
the matching upload type, has already been taken, or was never
issued.
DeformSlotsExhausted
No deformer slots remain. The registry has a fixed budget set by the
vertex-stage storage-buffer limit; once all slots are taken, callers
must release one with unregister_deformer (when implemented) before
registering another.
DeformNameTaken
A deformer with this name is already registered.
DeformShaderInvalid
The composed mesh-family shader failed validation, either because the
supplied wgsl_body is malformed or because composition produced an
invalid module. The reason carries the underlying validator message
and identifies which shader failed.
LodGroupEmpty
A LOD group was registered with no levels.
LodLevelCountMismatch
The mesh list and threshold list passed to register_lod_group differ
in length. Each level needs exactly one threshold.
LodThresholdsNotDescending
LOD thresholds must strictly decrease from the full level to the crudest, since each level applies to a smaller on-screen size than the one before.
LodLevelIncompatible
A level’s mesh is not compatible with the other levels in the group: a switch to it would change rendering. Today this means its named attribute set or its deformer attachment differs from level 0.
Fields
LodGroupNotFound
A LOD group id does not refer to a registered group.
Trait Implementations§
Source§impl Clone for ViewportError
impl Clone for ViewportError
Source§fn clone(&self) -> ViewportError
fn clone(&self) -> ViewportError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ViewportError
impl Debug for ViewportError
Source§impl Display for ViewportError
impl Display for ViewportError
Source§impl Error for ViewportError
impl Error for ViewportError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for ViewportError
impl RefUnwindSafe for ViewportError
impl Send for ViewportError
impl Sync for ViewportError
impl Unpin for ViewportError
impl UnsafeUnpin for ViewportError
impl UnwindSafe for ViewportError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.