Skip to content

Conversation

@Wumpf
Copy link
Member

@Wumpf Wumpf commented Oct 1, 2025

Connections

Description
Induces a breaking change into wgpu::PollType in order to:

  • not silently change behavior subtly
  • have less variants on wgpu::PollType

Testing
Existing test + (kind of unrelated) new tests with max timeout.

Squash or Rebase?
squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@Wumpf Wumpf requested a review from cwfitzgerald October 1, 2025 17:13
@Wumpf
Copy link
Member Author

Wumpf commented Oct 1, 2025

@cwfitzgerald ping as requested

let maintain_result;
(user_callbacks, maintain_result) =
device.maintain(fence, wgt::PollType::Wait, snatch_guard);
device.maintain(fence, wgt::PollType::wait_indefinitely(), snatch_guard);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is curious. the previous pr changed behavior here without noticing. I do not think this is a concern, but it's an interesting subtlety

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? We need to wait for idle before replacing the surface?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but before that had implicit timeout as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah true.

// <https://github.com/gfx-rs/wgpu/pull/5012> to be split up, as
// it has meaning in that PR.
Self::WaitForSubmissionIndex(submission_index)
pub fn wait_indefinitely() -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: Rust's std favors associated constants for cases like this (i.e., {integer}:::MIN,MAX, and this feels sorta the same. I'm not inclined to block, just curious if this had been considered.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm true. I'd actually prefer a constant here rather than calling a method. But where I'm coming here is that there was a method before

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite that I have no strong opinion, opting for laziness (==sticking closer to status quo) unless someone expresses a clear preference :)

Copy link
Member

@ErichDonGubler ErichDonGubler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with current content, though I'll let @cwfitzgerald give a final once-over, since release is imminent and this PR is in response to his concrete concerns.

@Wumpf
Copy link
Member Author

Wumpf commented Oct 1, 2025

Thanks for the thorough review @ErichDonGubler, good suggestions/corrections all around!

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

let maintain_result;
(user_callbacks, maintain_result) =
device.maintain(fence, wgt::PollType::Wait, snatch_guard);
device.maintain(fence, wgt::PollType::wait_indefinitely(), snatch_guard);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? We need to wait for idle before replacing the surface?

@cwfitzgerald cwfitzgerald merged commit 333f811 into gfx-rs:trunk Oct 1, 2025
41 checks passed
@Wumpf Wumpf deleted the poll-timeouts-follow-up branch October 2, 2025 06:39
sharmajai pushed a commit to sharmajai/wgpu that referenced this pull request Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants