mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Make BufferAccessError (de)serializable
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
d03b7e239d
commit
fc87033b30
@ -364,6 +364,8 @@ fn map_buffer<A: HalApi>(
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(bound(deserialize = "'de: 'static")))]
|
||||
pub struct DeviceMismatch {
|
||||
pub(super) res: ResourceErrorIdent,
|
||||
pub(super) res_device: ResourceErrorIdent,
|
||||
@ -388,6 +390,8 @@ impl std::fmt::Display for DeviceMismatch {
|
||||
impl std::error::Error for DeviceMismatch {}
|
||||
|
||||
#[derive(Clone, Debug, Error)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(bound(deserialize = "'de: 'static")))]
|
||||
#[non_exhaustive]
|
||||
pub enum DeviceError {
|
||||
#[error("{0} is invalid.")]
|
||||
|
@ -76,6 +76,7 @@ impl TrackingData {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct ResourceErrorIdent {
|
||||
r#type: &'static str,
|
||||
label: String,
|
||||
@ -341,6 +342,8 @@ pub struct BufferMapOperation {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Error)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(bound(deserialize = "'de: 'static")))]
|
||||
#[non_exhaustive]
|
||||
pub enum BufferAccessError {
|
||||
#[error(transparent)]
|
||||
@ -389,6 +392,8 @@ pub enum BufferAccessError {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Error)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(bound(deserialize = "'de: 'static")))]
|
||||
#[error("Usage flags {actual:?} of {res} do not contain required usage flags {expected:?}")]
|
||||
pub struct MissingBufferUsageError {
|
||||
pub(crate) res: ResourceErrorIdent,
|
||||
@ -405,6 +410,8 @@ pub struct MissingTextureUsageError {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Error)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(bound(deserialize = "'de: 'static")))]
|
||||
#[error("{0} has been destroyed")]
|
||||
pub struct DestroyedResourceError(pub ResourceErrorIdent);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user