Repository navigation
fix(core): terrain cover passes no longer re-update draped layers - #10851
chrisgervang wants to merge 1 commit into
Conversation
Terrain covers render into a WebMercatorViewport of their own making, one per terrain tile. LayersPass activated that viewport on every layer it drew, which immediately re-ran Layer.updateState, and the screen pass then undid it. A draped PathLayer re-tessellated twice a frame and kept needsRedraw set, so every cover re-rendered forever. Mark the terrain height map, cover and cover-picking passes as auxiliary so layers keep the update state they have for the primary viewport. Projection uniforms already come from the pass viewport, so drawing is unchanged.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 b34751e. Configure here.
| pass: `terrain-cover-picking-${terrainCover.id}`, | ||
| layers, | ||
| viewports: [viewport], | ||
| isAuxiliaryPass: true, |
There was a problem hiding this comment.
Picking covers still activate viewports
Medium Severity
Setting isAuxiliaryPass in renderTerrainCover has no effect because PickLayersPass._drawPickingBuffer rebuilds the options object and omits the flag. Cover picking still calls activateViewport, so a draped PathLayer on GlobeView re-tessellates on hover and can leave needsRedraw set.
Reviewed by Cursor Bugbot for commit b34751e. Configure here.
|
| renderOnce(auxiliaryViewport, false); | ||
| expect( | ||
| layer.state.tessellationResolution, | ||
| 'a primary pass still re-tessellates on viewport change' | ||
| ).toBeUndefined(); |
There was a problem hiding this comment.
Test leaves GPU resources allocated
The new test initializes a PathLayer but never calls layerManager.finalize(). Its model and attribute buffers stay allocated on the shared test device. Wrap the test body in try/finally and finalize the manager so resources are released even when an assertion fails.


For #10850
Background
Terrain covers render into a
WebMercatorViewportof their own making, one per terrain tile.LayersPassactivated that viewport on every layer it drew, which immediately re-ranLayer.updateState, and the screen pass undid it. A drapedPathLayerre-tessellated twice a frame and keptneedsRedrawset, so every cover re-rendered forever. Projection uniforms already come from the pass viewport, so layers never needed to adopt it.terrain-extension-drape-fill-globewithstroked: true, webgl/SwiftShader:needsRedrawfalseevery frameA
GlobeView+TerrainExtensionapp containing anyPathLayernow reaches idle instead of re-tessellating and re-draping its whole dataset every frame.Change List
LayersPassRenderOptions: addisAuxiliaryPassLayersPass: auxiliary passes skiplayer.activateViewportTerrainPass/TerrainPickingPass: mark cover and height-map passes auxiliaryTODO
TerrainCover(second bug in [Bug] TerrainExtension drape: draped layers never settle, and every cover draws every feature #10850) is untouched.MaskPassbuilds its own viewport the same way and may want the same flag.Note
Medium Risk
Changes when layers see viewport changes during multi-pass rendering; limited to auxiliary passes and terrain paths, but could affect layer update timing if mis-flagged.
Overview
Adds an
isAuxiliaryPassrender option so offscreen passes (terrain height maps and per-tile covers, including picking) no longer calllayer.activateViewportfor their transient viewports. Layers keep update/tessellation state tied to the primary screen viewport while projection uniforms still come from the pass viewport, which stops draped layers (e.g.PathLayeronGlobeView) from re-tessellating every frame and leavingneedsRedrawstuck on.Terrain
TerrainPass/TerrainPickingPassset the flag on those auxiliary renders. A newLayersPass#isAuxiliaryPassunit test locks in the behavior; the globe terrain drape render test comment is updated to reflect performance-only stroke omission.Reviewed by Cursor Bugbot for commit b34751e. Bugbot is set up for automated code reviews on this repo. Configure here.