-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interior mutablilty for re_renderer's static resource pools (RenderPi…
…peline/Shader/Layouts/etc.) (#4421) ### What * Prerequisite for #1325 * Followed by #4422 The dynamic resource pool (textures, buffers, bindgroups) was already interior mutable. The static resource pool (mostly append only pool) however, still required mutable access. This PR addresses this. The actual tricky part is the implications this has on the draw step: `wgpu::RenderPass<'a>` expects all passed in references to live for `'a`. This isn't much of a problem we have with resources from the dynamic resource pool since there the handles are actually Arcs to the underlying wgpu resources. However we can't do this with RenderPipelines (the only relevant static resource for this case) though since we want to be able to swap out what the handle points to for shader reloading. This means we need to hold the lock read lock on render pipelines for the entirety of the pass recording. This is quite nice and easy for our ViewBuilder draws (== individual space views), but hard for the "compositing step" where we draw into egui's render pass. This is solved by taking out all render pipelines of the lock and putting them back in at the start of the frame. Once wgpu lifts this restrictions we can simplify things a bit! (to be continued with follow-up PRs!) ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Full build: [app.rerun.io](https://app.rerun.io/pr/4421/index.html) * Partial build: [app.rerun.io](https://app.rerun.io/pr/4421/index.html?manifest_url=https://app.rerun.io/version) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4421) - [Docs preview](https://rerun.io/preview/8e4b0d88d9d01df8121a84850b251c1840494695/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/8e4b0d88d9d01df8121a84850b251c1840494695/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --- Part of series towards more multithreading in the viewer! * #4387 * #4404 * #4389 * You are here ➡️ #4421 * #4422 * #4430
- Loading branch information
Showing
26 changed files
with
429 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.