MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / clearFrustumTextureCache

Function clearFrustumTextureCache

src/hooks/useFrustumTexture.ts:132–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130 * Call this when loading a new reconstruction.
131 */
132export function clearFrustumTextureCache(): void {
133 frustumBitmapCacheGeneration++;
134 frustumBitmapLoads.clear();
135
136 // IMPORTANT: Dispose textures BEFORE closing bitmaps to prevent WebGL errors
137 // When a texture has needsUpdate=true, Three.js will try to upload the bitmap data
138 // on the next render. If we close the bitmap first, we get "source data detached" errors.
139
140 clearActiveFrustumTextures(activeTextures);
141
142 // Clear high-res selected image texture
143 clearSelectedImageTextureCache();
144
145 // NOW safe to close bitmap cache (textures no longer reference them)
146 clearFrustumBitmapCache(bitmapCache);
147 notifyFrustumTextureCacheChanged();
148}
149
150/**
151 * Pause frustum texture processing (e.g., during camera movement).

Callers 1

Calls 5

clearFrustumBitmapCacheFunction · 0.90
clearMethod · 0.65

Tested by

no test coverage detected