refactor: Global::device_poll: hoist submission_index extr.

This commit is contained in:
Erich Gubler 2024-03-12 10:17:44 -04:00
parent fe28eda3e0
commit c5ee3b6880

View File

@ -2097,16 +2097,16 @@ impl Global {
.get(device_id)
.map_err(|_| DeviceError::Invalid)?;
let (closures, queue_empty) = {
if let wgt::Maintain::WaitForSubmissionIndex(submission_index) = maintain {
if submission_index.queue_id != device_id.transmute() {
return Err(WaitIdleError::WrongSubmissionIndex(
submission_index.queue_id,
device_id,
));
}
if let wgt::Maintain::WaitForSubmissionIndex(submission_index) = maintain {
if submission_index.queue_id != device_id.transmute() {
return Err(WaitIdleError::WrongSubmissionIndex(
submission_index.queue_id,
device_id,
));
}
}
let (closures, queue_empty) = {
let fence = device.fence.read();
let fence = fence.as_ref().unwrap();
device.maintain(fence, maintain)?