-
Notifications
You must be signed in to change notification settings - Fork 990
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
Reintroduce computepass->encoder lifetime constraint and make it opt-out via wgpu::ComputePass::forget_lifetime
#5768
Conversation
…out via `wgpu::ComputePass::make_static`
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.
You pinged me, so you get my review 😁
The most important comment in this review bundle is that I think the name make_static()
needs work.
1f56788
to
b147e8c
Compare
b147e8c
to
df6f891
Compare
wgpu::ComputePass::make_static
wgpu::ComputePass::forget_lifetime
thanks again, I'm much happier with this now! |
AFAICT, controls to |
Connections
RenderPass
make it difficult to use. #1453ComputePass
to its parent command encoder #5620Description
As suggested on Matrix chat by @kpreid.
In #5620,
wgpu::ComputePass
lost its explicit lifetime constraint towgpu::CommandEncoder
. This constraint prevented use of the command encoder while a pass is recorded. This is still an error, but now a runtime error. While removing this lifetime is very useful especially for library authors, it also prevented trivial incorrect api usage, i.e. that PR was great but also created a massive footgun ;-).Here, we remedy this issue by re-introducing the exact same lifetime constraint but making it opt-out with a zero-overhead
forget_lifetime
method.Testing
Existing tests have been adjusted - compilation failed as expected without these adjustments!
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.