Open Nelarius opened 3 years ago
Iterating over all nodes, both used and unused, seems to cause continuous issues due to the complicated logic in the object pool and free list usage: https://github.com/Nelarius/imnodes/issues/71, https://github.com/Nelarius/imnodes/issues/59, https://github.com/Nelarius/imnodes/issues/58
We should only iterate over the nodes which have actually been submitted this frame. We already maintain the list of submitted node indices, so it could be used for this purpose as well.
Once this is done, this commit can be reverted: https://github.com/Nelarius/imnodes/commit/f1bda7257d3eb0bb1942e465c4174211ae577f29.
ObjectPool::free_list
ObjectPool::in_use
Primary concerns
Iterating over all nodes, both used and unused, seems to cause continuous issues due to the complicated logic in the object pool and free list usage: https://github.com/Nelarius/imnodes/issues/71, https://github.com/Nelarius/imnodes/issues/59, https://github.com/Nelarius/imnodes/issues/58
We should only iterate over the nodes which have actually been submitted this frame. We already maintain the list of submitted node indices, so it could be used for this purpose as well.
Once this is done, this commit can be reverted: https://github.com/Nelarius/imnodes/commit/f1bda7257d3eb0bb1942e465c4174211ae577f29.
Secondary concerns
ObjectPool::free_list
is updated every frame. It should be enough to add the free slot once to the list and retain it.ObjectPool::in_use
is not needed, if we can compare the submission indices of this frame and the previous frame.