mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 00:41:07 +01:00
[remote] Add BufferMapError (#10367)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
2 files changed
+21
No files matched your search
@@ -168,3 +168,9 @@ pub enum PipelineError {
|
||||
Validation(String),
|
||||
Internal(String),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
pub enum BufferMapError {
|
||||
Aborted(String),
|
||||
Operation(String),
|
||||
}
|
||||
@@ -36,3 +36,18 @@ pub mod hub;
|
||||
pub mod id;
|
||||
pub mod registry;
|
||||
pub mod storage;
|
||||
|
||||
pub fn map_buffer_access_error(
|
||||
err: wgpu_core::resource::BufferAccessError,
|
||||
) -> wgpu_core_remote_types::BufferMapError {
|
||||
match err {
|
||||
e
|
||||
@ wgpu_core::resource::BufferAccessError::Device(wgpu_core::device::DeviceError::Lost) => {
|
||||
wgpu_core_remote_types::BufferMapError::Aborted(e.to_string())
|
||||
}
|
||||
e @ wgpu_core::resource::BufferAccessError::MapAborted => {
|
||||
wgpu_core_remote_types::BufferMapError::Aborted(e.to_string())
|
||||
}
|
||||
e => wgpu_core_remote_types::BufferMapError::Operation(e.to_string()),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user