You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* share timestamp write struct
* Make name of set_push_constants methods consistently plural
* remove lifetime bounds of resources passed into render pass
* first render pass resource ownership test
* introduce dynrenderpass & immediately create ArcCommands and take ownership of resources passed on pass creation
* Use of dynrenderpass in deno
* Separate active occlusion & pipeline statitics query
* resolve render/compute command is now behind `replay` feature
* add vertex & index buffer to ownership test
* test for pipeline statistics query
* add occlusion query set to pass resource test
* add tests for resource ownership of render pass query timestamps
* RenderPass can now be made 'static just like ComputePass. Add respective test
* Extend encoder_operations_fail_while_pass_alive test to also check encoder locking errors with render passes
* improve changelog entry on lifetime bounds
TODO(wumpf): This is still work in progress. Should write a bit more about it. Also will very likely extend to `wgpu::RenderPass` before release.
46
+
`wgpu::RenderPass` & `wgpu::ComputePass` recording methods (e.g. `wgpu::RenderPass:set_render_pipeline`) no longer impose a lifetime constraint to objects passed to a pass (like pipelines/buffers/bindgroups/query-sets etc.).
47
+
48
+
This means the following pattern works now as expected:
// Change pipeline container - this requires mutable access to `pipelines` while one of the pipelines is in use.
55
+
pipelines.push(/* ... */);
56
+
// Continue pass recording.
57
+
cpass.set_bindgroup(...);
58
+
```
59
+
Previously, a set pipeline (or other resource) had to outlive pass recording which often affected wider systems,
60
+
meaning that users needed to prove to the borrow checker that `Vec<wgpu::RenderPipeline>` (or similar constructs)
61
+
aren't accessed mutably for the duration of pass recording.
47
62
48
-
`wgpu::ComputePass` recording methods (e.g. `wgpu::ComputePass:set_render_pipeline`) no longer impose a lifetime constraint passed in resources.
49
63
50
-
Furthermore, you can now opt out of `wgpu::ComputePass`'s lifetime dependency on its parent `wgpu::CommandEncoder` using `wgpu::ComputePass::forget_lifetime`:
64
+
Furthermore, you can now opt out of `wgpu::RenderPass`/`wgpu::ComputePass`'s lifetime dependency on its parent `wgpu::CommandEncoder` using `wgpu::RenderPass::forget_lifetime`/`wgpu::ComputePass::forget_lifetime`:
⚠️ As long as a `wgpu::ComputePass` is pending for a given `wgpu::CommandEncoder`, creation of a compute or render pass is an error and invalidates the `wgpu::CommandEncoder`.
58
-
This is very useful for library authors, but opens up an easy way for incorrect use, so use with care.
59
-
`forget_lifetime` is zero overhead and has no side effects on pass recording.
71
+
⚠️ As long as a `wgpu::RenderPass`/`wgpu::ComputePass` is pending for a given `wgpu::CommandEncoder`, creation of a compute or render pass is an error and invalidates the `wgpu::CommandEncoder`.
72
+
`forget_lifetime` can be very useful for library authors, but opens up an easy way for incorrect use, so use with care.
73
+
This method doesn't add any additional overhead and has no side effects on pass recording.
60
74
61
-
By @wumpf in [#5569](https://github.com/gfx-rs/wgpu/pull/5569), [#5575](https://github.com/gfx-rs/wgpu/pull/5575), [#5620](https://github.com/gfx-rs/wgpu/pull/5620), [#5768](https://github.com/gfx-rs/wgpu/pull/5768) (together with @kpreid), [#5671](https://github.com/gfx-rs/wgpu/pull/5671).
75
+
By @wumpf in [#5569](https://github.com/gfx-rs/wgpu/pull/5569), [#5575](https://github.com/gfx-rs/wgpu/pull/5575), [#5620](https://github.com/gfx-rs/wgpu/pull/5620), [#5768](https://github.com/gfx-rs/wgpu/pull/5768) (together with @kpreid), [#5671](https://github.com/gfx-rs/wgpu/pull/5671), [#5794](https://github.com/gfx-rs/wgpu/pull/5794), [#5884](https://github.com/gfx-rs/wgpu/pull/5884).
0 commit comments