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

Make compute pass end consume the pass #5575

Merged
merged 7 commits into from
May 25, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Apr 21, 2024

Connections

Part of a series towards lifetime removal on compute passes:

Description

  • avoid copies on compute pass end:
    Some work in Separate out ComputeCommand id->arc resolve (a step towards no lifetimes on wgpu::ComputePass) #5432 highlighted that a compute pass (render pass as well, but let's ignore this for now) isn't fully consumed during pass ending which means we have to do a couple of copies despite the fact that a pass can not be consumed twice.
  • error on ending compute pass twice:
    Any operation on an ended compute pass now causes an validation error (as it should per spec!). As expected this allows to remove a few copies (including needless reference count increment + decrement!). Naturally, this means now that all operations on the compute pass are failable
  • rename run to end, make end operation part of compute pass:
    Previously, ending a pass was seen as an operation on the command encoder across the api/crate layers. Now it is part of the render/compute pass in accordance with the WebGPU spec. This is relatively minor but also comes with an error check.
  • improve error handling:
    Compute pass errors make now use of its label

Testing
Existing tests still pass, should be enough for this one.

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 force-pushed the compute-pass-end-refactor branch 2 times, most recently from f2dfd02 to e2d0458 Compare April 23, 2024 07:17
@Wumpf Wumpf mentioned this pull request May 5, 2024
6 tasks
@Wumpf Wumpf force-pushed the compute-pass-end-refactor branch from e2d0458 to f02fab0 Compare May 14, 2024 20:10
@Wumpf Wumpf marked this pull request as ready for review May 14, 2024 20:16
@Wumpf Wumpf requested a review from a team as a code owner May 14, 2024 20:16
@ErichDonGubler ErichDonGubler self-assigned this May 23, 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: These changes make sense to me. Glad to see them!

nitpick: I've taken the liberty of modifying history a bit here, so review is easier and that we might reasonably consider rebasing instead of squashing. I've made individual conversations where it made sense. For general changes, I've folded the following commits into parents: d781e30, e07ba12, 6315094

wgpu-core/src/command/render.rs Show resolved Hide resolved
wgpu-core/src/command/render.rs Show resolved Hide resolved
wgpu/src/backend/wgpu_core.rs Show resolved Hide resolved
wgpu-core/src/command/compute.rs Show resolved Hide resolved
wgpu-core/src/command/compute.rs Show resolved Hide resolved
@ErichDonGubler ErichDonGubler force-pushed the compute-pass-end-refactor branch from f02fab0 to ecd9699 Compare May 23, 2024 19:50
@ErichDonGubler

This comment was marked as resolved.

@Wumpf

This comment was marked as resolved.

@ErichDonGubler

This comment was marked as resolved.

@Wumpf Wumpf merged commit 2fd0994 into gfx-rs:trunk May 25, 2024
27 checks passed
@Wumpf Wumpf deleted the compute-pass-end-refactor branch May 25, 2024 16:54
@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