mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 16:31:11 +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
@@ -161,8 +161,6 @@ pub enum ComputePassErrorInner {
|
||||
InvalidParentEncoder,
|
||||
#[error("Bind group at index {0:?} is invalid")]
|
||||
InvalidBindGroup(u32),
|
||||
#[error("Device {0:?} is invalid")]
|
||||
InvalidDevice(id::DeviceId),
|
||||
#[error("Bind group index {index} is greater than the device's requested `max_bind_group` limit {max}")]
|
||||
BindGroupIndexOutOfRange { index: u32, max: u32 },
|
||||
#[error("Compute pipeline {0:?} is invalid")]
|
||||
@@ -452,12 +450,7 @@ impl Global {
|
||||
let pass_scope = PassErrorScope::Pass(Some(cmd_buf.as_info().id()));
|
||||
|
||||
let device = &cmd_buf.device;
|
||||
if !device.is_valid() {
|
||||
return Err(ComputePassErrorInner::InvalidDevice(
|
||||
cmd_buf.device.as_info().id(),
|
||||
))
|
||||
.map_pass_err(pass_scope);
|
||||
}
|
||||
device.check_is_valid().map_pass_err(pass_scope)?;
|
||||
|
||||
let mut cmd_buf_data = cmd_buf.data.lock();
|
||||
let cmd_buf_data = cmd_buf_data.as_mut().unwrap();
|
||||
|
||||
Reference in new issue
Block a user