Skip to content
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

More complete implementation of "lose the device". #4645

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

bradwerth
Copy link
Contributor

@bradwerth bradwerth commented Nov 6, 2023

Checklist

  • Run cargo clippy.
  • Run cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
N/A

Description
This provides a way for wgpu-core to specify a callback on "lose the device". It ensures this callback is called at the appropriate times: either after device.destroy has empty queues, or on demand from device.lose.

Testing
A test has been added to device.rs.

This provides a way for wgpu-core to specify a callback on "lose the
device". It ensures this callback is called at the appropriate times:
either after device.destroy has empty queues, or on demand from
device.lose.

A test has been added to device.rs.
@bradwerth bradwerth requested a review from a team as a code owner November 6, 2023 23:00
Copy link
Contributor

@nical nical left a comment

Choose a reason for hiding this comment

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

Nitpick: "callback" instead of "closure", otherwise 👍

@bradwerth
Copy link
Contributor Author

Nitpick: "callback" instead of "closure", otherwise 👍

The remaining use of "closure" is in DeviceLostClosure which wraps DeviceLostCallback and DeviceLostCallbackC. I can't rename that to use "callback" without introducing naming redundancy. This naming is also matching the naming pattern established by SubmittedWorkDoneClosure. I'm going to leave this as it is.

@nical nical merged commit 4e65eca into gfx-rs:trunk Nov 8, 2023
27 checks passed
@bradwerth bradwerth deleted the deviceLostCallback branch November 8, 2023 21:24
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.

2 participants