mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 09:09:19 +01:00
introduce Device.check_is_valid
This commit is contained in:
1 parent
508ece312d
commit
edc2cd9615
9 files changed
+84
-98
No files matched your search
@@ -136,9 +136,7 @@ impl Global {
|
||||
let (device, config) = if let Some(ref present) = *surface.presentation.lock() {
|
||||
match present.device.downcast_clone::<A>() {
|
||||
Some(device) => {
|
||||
if !device.is_valid() {
|
||||
return Err(DeviceError::Lost.into());
|
||||
}
|
||||
device.check_is_valid()?;
|
||||
(device, present.config.clone())
|
||||
}
|
||||
None => return Err(SurfaceError::NotConfigured),
|
||||
@@ -303,9 +301,7 @@ impl Global {
|
||||
};
|
||||
|
||||
let device = present.device.downcast_ref::<A>().unwrap();
|
||||
if !device.is_valid() {
|
||||
return Err(DeviceError::Lost.into());
|
||||
}
|
||||
device.check_is_valid()?;
|
||||
let queue = device.get_queue().unwrap();
|
||||
|
||||
#[cfg(feature = "trace")]
|
||||
@@ -397,9 +393,7 @@ impl Global {
|
||||
};
|
||||
|
||||
let device = present.device.downcast_ref::<A>().unwrap();
|
||||
if !device.is_valid() {
|
||||
return Err(DeviceError::Lost.into());
|
||||
}
|
||||
device.check_is_valid()?;
|
||||
|
||||
#[cfg(feature = "trace")]
|
||||
if let Some(ref mut trace) = *device.trace.lock() {
|
||||
|
||||
Reference in new issue
Block a user