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,7 +2097,6 @@ 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(
@ -2107,6 +2106,7 @@ impl Global {
}
}
let (closures, queue_empty) = {
let fence = device.fence.read();
let fence = fence.as_ref().unwrap();
device.maintain(fence, maintain)?