#[non_exhaustive]pub enum Error {
Show 18 variants
DegenerateGrid {
samples: [u32; 3],
},
InvalidCellSize,
InvalidOrigin,
GridTooLarge {
samples: [u32; 3],
},
SampleCountMismatch {
expected: u64,
got: u64,
},
NoAdapter,
DeviceUnavailable,
MapFailed,
TimestampsUnsupported,
FeaturesUnsupported {
missing: Features,
},
DeviceLost,
ShaderModuleMissing {
name: String,
},
ShaderCircularInclude {
name: String,
},
ShaderDirective {
module: String,
line: usize,
},
MeshShadersUnavailable,
UnalignedReadback {
bytes: u64,
stride: u64,
},
ScanTooLong {
elements: u32,
max: u32,
},
DeferredQueueFull {
capacity: usize,
},
}Expand description
Everything this crate can fail at.
One variant per genuinely distinct cause. There is deliberately no
catch-all Other(String): a caller that cannot tell “no adapter” from
“wrong buffer length” cannot react to either, and a variant that carries a
message is a way of not deciding what the error is.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DegenerateGrid
A grid axis had fewer than two samples, so it contains no cells.
InvalidCellSize
The cell size was not a finite positive number.
InvalidOrigin
The grid origin was not finite.
GridTooLarge
The grid describes more samples than a u64 byte count can address.
SampleCountMismatch
An upload’s slice length disagreed with the grid it is being written to.
NoAdapter
No adapter matched the request. There is no software fallback here on purpose: a caller told “GPU extraction is running” while it is on a CPU reference driver has been misinformed about the only thing that matters.
The adapter refused to create a device with the requested limits.
MapFailed
Mapping a buffer for read-back failed.
TimestampsUnsupported
Timestamp queries were asked for and are not usable on this device.
Ticket: R-069 (P-71). Raised when the device was not created with
wgpu::Features::TIMESTAMP_QUERY, when the queue reports a timestamp
period of zero — a driver that advertises the feature and does not
implement it — or when a resolved pair ends before it begins.
It refuses rather than degrading, on purpose. Falling back to
Instant::now() under a GPU-side column name would report a number that
was named and not measured, which is the failure the experiment harness’s
missing-column panic exists to prevent, arriving by a different door.
FeaturesUnsupported
The adapter does not advertise a feature the caller asked for.
R-068. Gpu::open previously returned Self::TimestampsUnsupported
for any missing feature, which was correct while timestamps were its
only caller and became a lie the moment with_subgroups existed: a
device without SUBGROUP would have reported that timestamps were
unavailable. Carrying the missing set means the error names what is
actually absent, and adding a third capability cannot reintroduce the
bug.
DeviceLost
The device disconnected or a submission never completed.
ShaderModuleMissing
A shader module was included, or composed, but never registered.
ShaderCircularInclude
A shader module includes itself, through some chain.
ShaderDirective
A preprocessor directive was malformed or unbalanced.
Fields
The device cannot run mesh shaders.
Returned rather than substituting a vertex-buffer pipeline: a caller told “drawing” while a different pipeline ran has been misinformed about the one thing they asked for.
UnalignedReadback
A read-back range was not a whole number of elements.
ScanTooLong
A scan was asked for more elements than one dispatch can cover.
Level 0 dispatches one workgroup per PrefixScan::BLOCK elements, and
max_compute_workgroups_per_dimension caps how many that can be.
Fields
DeferredQueueFull
crate::DeferredGeometry was asked to hold one more read-back than it
has room for.
R-071 (P-71 C3). Its own variant rather than Self::DeviceLost or a
silent drop, because it is the one error here that is not a failure:
it is the queue telling a frame-budget scheduler that this frame’s
submissions have caught up with last frame’s collections, which is the
signal a caller uses to stop submitting. A dropped read-back would be a
chunk of geometry that was extracted, paid for and never delivered, and
nothing downstream could tell that from a chunk with no surface in it.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.