Conversation
Summary of ChangesHello @TrueDoctor, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly optimizes memory management within the rendering pipeline by implementing a texture pooling system. By leveraging Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a texture pool to the render cache node, aimed at reducing memory consumption and allocation overhead, particularly for WASM-based viewport rendering. By wrapping wgpu::Texture in std::sync::Arc and tracking strong reference counts, the system can now reuse textures that are no longer in use by the editor or previous frames. The implementation is clean and leverages Rust's ownership model effectively to manage GPU resource lifetimes without explicit manual pooling logic in most places. The identified redundant comment should be removed to maintain code clarity.
| let exec = editor_api.application_io.as_ref().unwrap().gpu_executor().unwrap(); | ||
| let (output_texture, combined_metadata) = composite_cached_regions(&all_regions, &viewport_bounds, physical_resolution, logical_scale, physical_scale, exec); | ||
|
|
||
| // TODO: Use texture pool to reuse existing unused textures instead of allocating fresh ones every time |
Reuse existing but no longer used viewport textures to reduce memory consumption while waiting for a gc on web