-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wgpu render pass on paint callback has now static lifetime (#5149)
A very common usability issue on egui-wgpu callbacks is that `paint` can't access any data that doesn't strictly outlive the callback resources' data. E.g. if the callback resources have an `Arc` to some resource manager, you can't easily pull out resources since you statically needed to ensure that those resource references outlived the renderpass, whose lifetime was only constrained to the callback resources themselves. Wgpu 22 no longer has this restriction! Its (render/compute-)passes take care of the lifetime of any passed resource internally. The lifetime constraint is _still_ opt-out since it protects from a common runtime error of adding commands/passes on the parent encoder while a previously created pass wasn't closed yet. This is not a concern in egui-wgpu since the paint method where we have to access the render pass doesn't even have access to the encoder!
- Loading branch information
Showing
4 changed files
with
36 additions
and
16 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