itowns icon indicating copy to clipboard operation
itowns copied to clipboard

fix(renderer): track render target usage before cleaning them up, to fix prematurely unloading textures

Open Neptilo opened this issue 5 months ago • 1 comments

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

Screencast from 19-11-2025 09:34:36.webm

Neptilo avatar Nov 21 '25 15:11 Neptilo

Could you give an example to reproduce the issue?

Desplandis avatar Dec 12 '25 14:12 Desplandis

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.

Neptilo avatar Dec 16 '25 09:12 Neptilo

@ftoromanoff This PR is ready for review again

Neptilo avatar Dec 17 '25 15:12 Neptilo