fix(renderer): track render target usage before cleaning them up, to fix prematurely unloading textures
Description
Track which array render targets are actually used when rendering each view. Then, when they would normally be disposed of because the cache managing them reaches its limit, we keep them in another map to only dispose of them once they are not used for rendering in any view.
Motivation and Context
When rendering array textures for new tiles, some tiles' textures were sometimes prematurely unloaded, leaving holes in the terrain where those tiles should be.
Screenshots
Could you give an example to reproduce the issue?
Could you give an example to reproduce the issue?
The issue can be observed in basic examples like view_3d_map.html. You can also reduce the limit of rtCache in LayeredMaterial to increase the chances of reproducing it.
@ftoromanoff This PR is ready for review again