ITADN

Same-name image replacement not visible with synchronous GeoJSONSource

#4326Openlouwers 创建于 2026-06-02
L
louwerscommented
Description from @grab-liyanjin > When `GeoJsonSource` is created with `synchronousUpdate = true`, replacing a style image under the same ID (same size) never propagated new pixels to the GPU, causing the symbol icon to remain frozen on its initial appearance. > > Root cause – two update paths were both short-circuited in the same frame: > > 1. `DynamicTextureAtlas::uploadIconsAndPatterns` derives a cache key (`uniqueId`) from the image ID hash and pixel dimensions. On every tile re-layout after a same-size replacement the existing atlas slot is reused and `isUploadNeeded()` returns false, so the new pixel data is never bulk-uploaded. > > 2. `populateImagePatches` is the intended fallback: it compares `iconPositions[id].version` against `ImageManager::updatedImageVersions[id]` and sub-region-uploads only when they differ. However, with `synchronousUpdate = true` the tile re-layout is triggered *within the same render-orchestrator frame* as `ImageManager::updateImage()`. The tile therefore receives `versionMap[id] = N` (the just-incremented value) during `onImagesAvailable`, stores that as `iconPositions[id].version`, and `populateImagePatches` finds `N == N` – nothing to do. Previous PR https://github.com/maplibre/maplibre-native/pull/4193 (we want to solve it in a different way) cc @alexcristici
0 条评论