mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
remove device invalidity checks from property accessors
accessing those properties is always fine
This commit is contained in:
parent
3e44a98088
commit
508ece312d
@ -105,9 +105,6 @@ impl Global {
|
|||||||
let hub = A::hub(self);
|
let hub = A::hub(self);
|
||||||
|
|
||||||
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
|
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
|
||||||
if !device.is_valid() {
|
|
||||||
return Err(InvalidDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(device.features)
|
Ok(device.features)
|
||||||
}
|
}
|
||||||
@ -119,9 +116,6 @@ impl Global {
|
|||||||
let hub = A::hub(self);
|
let hub = A::hub(self);
|
||||||
|
|
||||||
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
|
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
|
||||||
if !device.is_valid() {
|
|
||||||
return Err(InvalidDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(device.limits.clone())
|
Ok(device.limits.clone())
|
||||||
}
|
}
|
||||||
@ -133,9 +127,6 @@ impl Global {
|
|||||||
let hub = A::hub(self);
|
let hub = A::hub(self);
|
||||||
|
|
||||||
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
|
let device = hub.devices.get(device_id).map_err(|_| InvalidDevice)?;
|
||||||
if !device.is_valid() {
|
|
||||||
return Err(InvalidDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(device.downlevel.clone())
|
Ok(device.downlevel.clone())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user