use std::fmt;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct BvhBuildError {
pub(super) resource: &'static str,
pub(super) index: u64,
pub(super) maximum: u32,
}
impl BvhBuildError {
#[must_use]
pub const fn resource(self) -> &'static str {
self.resource
}
#[must_use]
pub const fn index(self) -> u64 {
self.index
}
#[must_use]
pub const fn maximum(self) -> u32 {
self.maximum
}
}
impl fmt::Display for BvhBuildError {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
formatter,
"{} index {} exceeds the GPU limit {}",
self.resource, self.index, self.maximum
)
}
}
impl std::error::Error for BvhBuildError {}