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

Fix QuerySet ownership of ComputePass #5671

Merged

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented May 5, 2024

Connections

Part of a series towards lifetime removal on compute passes:

last piece of solving lifetime constraints for ComputePass

Description
Technically this PR is a bugfix: Previously, when destroying a QuerySet that is used in any way (either write_timestamp, ComputePassTimestampWrites or begin_pipeline_statistics_query) before executing the pass, we would crash.
This solves this as in the PRs before by taking ownership of the query the moment it is provided.

Testing
Adds two new tests that test for gracefully handling destroyed query set before the compute pass is executed.
Both tests failed before the fix.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Wumpf Wumpf requested a review from a team as a code owner May 5, 2024 22:02
@Wumpf Wumpf marked this pull request as draft May 5, 2024 22:02
@Wumpf Wumpf changed the title Fix QuerySet reference counting on ComputePass Fix QuerySet ownership of ComputePass May 5, 2024
@Wumpf Wumpf force-pushed the andreas/lifetime-free-computepass3 branch 4 times, most recently from 6f934ec to 1a0f13a Compare May 29, 2024 22:45
@Wumpf Wumpf marked this pull request as ready for review May 29, 2024 22:50
@ErichDonGubler ErichDonGubler self-assigned this Jun 3, 2024
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.

praise: This was easier to audit than I thought it would be, based on the LoC. 😀 Whew! Sorry for the delay in getting to this.

wgpu-core/src/command/query.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@ErichDonGubler ErichDonGubler force-pushed the andreas/lifetime-free-computepass3 branch from dfcf446 to 9ab8e3a Compare June 4, 2024 01:19
@ErichDonGubler ErichDonGubler enabled auto-merge (squash) June 4, 2024 01:20
@ErichDonGubler ErichDonGubler disabled auto-merge June 4, 2024 01:20
@ErichDonGubler ErichDonGubler enabled auto-merge (squash) June 4, 2024 01:20
@ErichDonGubler ErichDonGubler merged commit 9a27ba5 into gfx-rs:trunk Jun 4, 2024
25 checks passed
@Wumpf Wumpf deleted the andreas/lifetime-free-computepass3 branch June 4, 2024 07:47
@Wumpf Wumpf mentioned this pull request Jun 26, 2024
6 tasks
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