[api] expose invalid submission index to PollError (#8169)

This commit is contained in:
Lucas Abel 2025-08-29 18:30:55 +02:00 committed by GitHub
parent 80a742094c
commit 5d4cf56689
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -138,6 +138,9 @@ impl WaitIdleError {
pub fn to_poll_error(&self) -> Option<wgt::PollError> {
match self {
WaitIdleError::Timeout => Some(wgt::PollError::Timeout),
&WaitIdleError::WrongSubmissionIndex(a, b) => {
Some(wgt::PollError::WrongSubmissionIndex(a, b))
}
_ => None,
}
}

View File

@ -4555,6 +4555,12 @@ pub enum PollError {
error("The requested Wait timed out before the submission was completed.")
)]
Timeout,
/// The requested Wait was given a wrong submission index.
#[cfg_attr(
feature = "std",
error("Tried to wait using a submission index ({0}) that has not been returned by a successful submission (last successful submission: {1})")
)]
WrongSubmissionIndex(u64, u64),
}
/// Status of device poll operation.