Add material texture cache cleanup method

This commit is contained in:
2026-05-18 16:02:47 +02:00
parent b2530191c1
commit ae42e4243a

View File

@@ -10743,6 +10743,14 @@ export class ViewportHost {
} }
} }
private clearMaterialTextureCache() {
for (const cachedTexture of this.materialTextureCache.values()) {
disposeMaterialTextureSet(cachedTexture.textureSet);
}
this.materialTextureCache.clear();
}
private getOrCreateTextureSet(material: MaterialDef) { private getOrCreateTextureSet(material: MaterialDef) {
const signature = createMaterialSignature(material, this.loadedImageAssets); const signature = createMaterialSignature(material, this.loadedImageAssets);
const cachedTexture = this.materialTextureCache.get(material.id); const cachedTexture = this.materialTextureCache.get(material.id);