-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly Deal with Timeouts #7030
base: trunk
Are you sure you want to change the base?
Conversation
I looked at the |
# Conflicts: # wgpu/src/lib.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
marvelous! <3
gl: wgpu::GlBackendOptions::from_env_or_default(), | ||
gl: wgpu::GlBackendOptions { | ||
fence_behavior: if cfg!(target_family = "wasm") { | ||
wgpu::GlFenceBehavior::AutoFinish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where in the tests are we relying on this, what would break if we use Normal
. Plz add comment
// After the wait, the queue should be empty. | ||
break 'error E::GpuWaitTimeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth a debug assert since this would be an implementation error, no?
let result = if queue_empty { | ||
if let Some(wait_submission_index) = wait_submission_index { | ||
// Assert to ensure that if we received a queue empty status, the fence shows the correct value. | ||
// This is defencive, as this should never be hit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This is defencive, as this should never be hit. | |
// This is defensive, as this should never be hit. |
@@ -370,73 +370,133 @@ impl Device { | |||
assert!(self.queue.set(Arc::downgrade(queue)).is_ok()); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comments in this file help a lot, thanks!
} | ||
} | ||
} | ||
|
||
/// Result of a maintain operation. | ||
pub enum MaintainResult { | ||
/// Error states after a poll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Error states after a poll | |
/// Error states after a device poll |
Timeout, | ||
} | ||
|
||
/// Status of poll operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Status of poll operation. | |
/// Status of device poll operation. |
Self::Wait => Maintain::Wait, | ||
Self::Poll => Maintain::Poll, | ||
Self::WaitForSubmissionIndex(i) => PollType::WaitForSubmissionIndex(func(i)), | ||
Self::Wait => PollType::Wait, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kinda tempted to take the opportunity and bake the "non-webgpu-ness" of those wait operations into the names, but I don't know how to do so without making things worse 🤷
Connections
Close #3601
Close #4589
Description
Describe what problem this is solving, and how it's solved.
Testing
Explain how this change is tested.
Checklist
cargo fmt
.taplo format
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.