Repository navigation
fix(core, extensions): stop terrain cover pass from re-tessellating draped layers on GlobeView - #10669
fix(core, extensions): stop terrain cover pass from re-tessellating draped layers on GlobeView#10669chrisgervang wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2ddf01b. Configure here.
[Medium impact] The change reaches shared layer drawing and terrain rendering. The continuous dash regression should be fixed before merging. Findings
SummaryAdds
|
26792ec to
f0f1666
Compare
d150c56 to
02b1a72
Compare
342a938 to
c888a35
Compare
…ir viewport `LayersPass._shouldDrawLayer()` calls `layer.activateViewport(viewport)` for every layer it draws. `Layer.activateViewport()` runs `_update()` whenever the viewport differs from the last activated one, so a layer that is drawn both by an off-screen pass with one viewport and by the screen pass with another is updated twice per frame. For layers whose state depends on the viewport (PathLayer re-tessellates when `viewport.resolution` / projectionMode change) this also calls `setNeedsRedraw()`, which can keep deck redrawing forever. Add an opt-out `activateViewport?: boolean` (default `true`) to `LayersPassRenderOptions`, threaded through `_getDrawLayerParams` into `_shouldDrawLayer`. The default path is unchanged; passes that render layers with a viewport other than the one they are drawn to screen with can pass `false` so the layer's viewport-dependent state stays bound to the screen viewport. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…layers on GlobeView A draped PathLayer (e.g. the stroke of a GeoJsonLayer with TerrainExtension) on GlobeView never settled: deck reported needsRedraw on every frame. The terrain cover pass draws drape layers with a flat WebMercatorViewport (resolution undefined, projectionMode WEB_MERCATOR) and the screen pass then draws the same layers with the GlobeViewport (resolution 10, projectionMode GLOBE); both passes activated their viewport on the layer, so `PathLayer.shouldUpdateState()` saw the tessellation resolution flip twice per frame, re-tessellated and flagged a redraw. The redraw marked the terrain cover dirty (`TerrainExtension.onNeedsRedraw`), which re-rendered the cover next frame and repeated the cycle. Render the terrain cover (color and picking) with `activateViewport: false`. Layers still receive the cover viewport through the `project` shader module props, but their viewport-dependent state stays bound to the screen viewport: on GlobeView the globe-tessellated path is drawn into the Mercator cover (extra subdivision vertices are collinear in Mercator) and Mercator-only state such as dash offsets is computed for the screen viewport. Tests: `terrain-extension-drape` is now expanded with `expandViewMatrix` into the MapView case (golden unchanged) and a fully stroked GlobeView twin `terrain-extension-drape-globe`, replacing the fills-only `terrain-extension-drape-fill-globe` workaround case and golden. Before the fix the stroked globe case hit the screenshot timeout (88 s); after it settles in ~12 s. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
c888a35 to
fc7d857
Compare
|
Superseded by #10851, which fixes the cover pass in |

Follow up of #10666
Background
A draped
PathLayeronGlobeViewnever settles: deck reportsneedsRedrawevery frame. The terrain cover pass draws drape layers with a flatWebMercatorViewportand the screen pass draws them again with theGlobeViewport.LayersPass._shouldDrawLayer()callslayer.activateViewport()each time,PathLayer.shouldUpdateState()seesviewport.resolutionandprojectionModechange, so the path is re-tessellated twice per frame, and each_update()setsneedsRedraw, which marks the terrain cover dirty again. The stroked globe drape case hits Playwright's 30 s screenshot timeout before this change and settles in about 12 s after it.GlobeViewterrain-extension-drape-globe: choropleth fills and strokes draped overTerrainLayertiles, San Francisco at zoom 11.5, pitch 60No before image: before this change the case never settles and the harness times out instead of producing a frame.
Change List
LayersPassRenderOptions: addactivateViewport?: boolean(defaulttrue), threaded to_shouldDrawLayer, so an off-screen pass can draw layers without rebinding their viewport. No existing pass sets itTerrainPassandTerrainPickingPass: render the terrain cover withactivateViewport: false; layers still receive the cover viewport throughshaderModuleProps.project.viewport. Picking passes no longer activate viewports since feat(core): layer coordinateSystem supports arbitrary CRS #10874, soPickLayersPassneeds no changeterrain-extension-drapealso renders underGlobeViewwith strokes, replacing the fills-onlyterrain-extension-drape-fill-globecase and golden from test(render): GlobeView terrain drape render case + fix TerrainExtension GlobeView docs #10666layers-pass.spec.tscovers default,falseand explicittrueCover-pass layers now keep
internalState.viewportbound to the screen viewport. OnGlobeViewa globe-tessellated path is drawn into the Mercator cover; the extra subdivision only adds collinear vertices in Mercator.renderHeightMapstill activates its viewport: it is gated on viewport changes and showed no loop.Ran the render spec headless on WebGL, the unit specs,
tscand lint.Note
Medium Risk
Changes core layer draw semantics for off-screen passes; limited to terrain cover paths today but affects when viewport-dependent layer state updates.
Overview
Fixes an infinite redraw on GlobeView when layers are draped over terrain: the terrain cover pass renders in Web Mercator while the screen pass uses the globe viewport, and each draw was calling
layer.activateViewport(), so viewport-dependent layers (e.g. PathLayer tessellation) kept invalidating state every frame.Adds
activateViewport?: boolean(defaulttrue) onLayersPassrender options so off-screen passes can draw without rebinding the layer’s viewport; projection for the pass still comes from shaderprojectuniforms. PickLayersPass forwards the flag; TerrainPass and TerrainPickingPass setactivateViewport: falsefor terrain cover (and picking cover).Unit tests cover default / opt-out / explicit true; render tests run the draped choropleth case on both Map and Globe with strokes as the regression guard.
Reviewed by Cursor Bugbot for commit 342a938. Bugbot is set up for automated code reviews on this repo. Configure here.
Generated by Claude Code