ITADN

WebGPURenderer: NodeManager.nodeBuilderCache appears to retain entries after cleanup when shadows are enabled

#33676Openyisky 创建于 2026-05-29
Y
yiskycommented
### Description I am seeing what appears to be a retention issue in the `WebGPURenderer` + nodes pipeline that is reproducible only when shadows are enabled. After scene objects and their related resources have been released, `NodeManager.nodeBuilderCache` still contains entries. Those remaining `NodeBuilderState` references appear to keep render-related objects reachable in Chrome heap snapshots. In the same test setup, if shadows are disabled, I can no longer reproduce the issue. At the moment, I cannot identify the exact root cause. Based on current testing, the problem seems to be associated with the shadow rendering path, but I cannot yet tell whether this is intended cache behavior, an incomplete cleanup path, or another internal lifecycle issue. ### Reproduction steps 1. Use `WebGPURenderer`. 2. Enable shadows. 3. Render a scene using node-based materials. 4. Remove the relevant objects from the scene and dispose the related resources. 5. Take a Chrome heap snapshot. ### Expected behavior After objects and related resources have been released, internal node builder cache entries associated with them should also be released, and the corresponding render-related objects should no longer remain reachable through `NodeManager.nodeBuilderCache`. ### Actual behavior When shadows are enabled, `NodeManager.nodeBuilderCache` still contains entries after cleanup. Those remaining entries appear to keep render-related objects reachable in heap snapshots. When shadows are disabled in the same test setup, I can no longer reproduce the issue. ### Notes - At this point, I have only confirmed the correlation with shadows being enabled. - I have not yet identified the exact internal cause. - I am therefore reporting this as a suspected cache/lifecycle issue rather than a confirmed root-cause diagnosis. ### Code Not available yet. ### Live example Not available yet. ### Screenshots <img width="3826" height="1789" alt="Image" src="https://github.com/user-attachments/assets/426c12a3-7945-43e1-9153-b10bb8febe56" /> <img width="3821" height="1578" alt="Image" src="https://github.com/user-attachments/assets/f7ad9749-6771-4fa0-b64c-ef50954a826b" /> <img width="3656" height="1721" alt="Image" src="https://github.com/user-attachments/assets/2d7ed46f-9300-4f52-ab30-31bae886ab22" /> <img width="3508" height="1573" alt="Image" src="https://github.com/user-attachments/assets/64626765-45c8-442e-85e4-77ee33b6d9ee" /> ### Version 0.184.0 ### Device Desktop ### Browser Chrome ### OS Windows
0 条评论