For some reason, TransformShader.TransformStateMap is leaking memory. When running one of simple tests with rotating cube, StateMap is fed with transforms, which is ok, but it never get cleaned up. Every frame, few objects get stuck there forever.
As far as I understand, StateMap tries to find StateNode for given transform. As it is not possible when transform has changed in any way, new StateNode is added - and never removed. Of course, with StateNode there is a stale reference to Transform3D, which in turn has a reference to matrix or two… While memory hit is not so bad (but it sums up quite quickly, something like 1MB per minute), I’m afraid that tree performance will get down after some time.
BTW, is there any particular reason to keep Transform nodes in TreeMap ? Do they have to be sorted in this order (seems more or less arbitrary, it is not a distance from viewpoint or something which could be used later) ? I’m afraid, that with more nodes, time used for sorting/checking it will start to take a lot of time.
