-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Description
Hi there, I found a bug with shader materials caching that leads to the accumulation of large data collections stored in program uniforms
Steps to reproduce:
- create SplatRenderer and load first scene via SplatMesh
- dispose SplatRenderer and SplatMesh
- look at heap memory dump and observe big amount of data inside programMaterial var
- repeat 1..3 to observe memory leak
minor code change WeakMap -> Map do this issue, as I can see
in master branch we can see
const programMaterial = new WeakMap<DynoProgram, THREE.RawShaderMaterial>();
in v2.0.0-preview branch:
const programMaterial = new Map<DynoProgram, THREE.RawShaderMaterial>();
code here
Also
SplatAccumulator.generatorProgram Map is a static link that never cleaned up. I can clear it using direct SplatAccumulator import, but I think it can be good to see it in dispose method too.
code here
I can make a PR to fix theese issues as well in case of it will not brake anything
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels