Repository navigation
feat(aggregation-layers): port GridLayer to WebGPU - #10482
Conversation
c31631f to
8b40ae8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b40ae86a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| return ( | ||
| <DeckGL | ||
| device={device} |
There was a problem hiding this comment.
Remount DeckGL when switching devices
When a user switches the example's WebGL2/WebGPU tab after mount, this updates the existing DeckGL instance instead of remounting it. The device-change path in modules/core/src/lib/deck.ts stops the old animation loop but replaces the layer, effect, renderer, and picker managers without finalizing the old ones, leaking their GPU resources on every toggle. Existing device-switching examples avoid this by keying the rendered app with device?.type; add the same key here so the previous Deck instance is finalized.
Useful? React with 👍 / 👎.
Goal
Port
GridLayerto WebGPU as a small, standalone follow-up to the landed ColumnLayer, HexagonLayer, and shared shader/device preparation work.WebGL GPU aggregation and the existing WebGL rendering path are unchanged. On WebGPU,
GridLayeruses its already-existing automatic CPU-aggregation fallback and renders the result through a dedicated WGSL grid-cell shader.Changes
GridCellLayershader following the already-landed HexagonLayer implementation.sourceunconditionally alongside the unchanged GLSL shader; there is no newisWebGPUshader-selection branch./examples/grid-layerroad-safety example using the landed shared website device store and persisted WebGL2/WebGPU tabs.Website example
GridLayerWhy this is low risk for WebGL
GridLayer.getAggregatorType()andWebGLAggregatorare not changed.sourceis ignored by the WebGL device.Validation
yarn buildyarn lint— passes with existing repository warnings only.yarn test-headless test/modules/aggregation-layers— 15 suites; 41 passed, 2 existing skipped.yarn test-render test/render/test-cases/grid-layer.spec.ts test/render/test-cases/hexagon-layer.spec.ts test/render/test-cases/screen-grid-layer.spec.ts test/render/test-cases/contour-layer.spec.ts— 18 passed.yarn test-website— production build passes with existing dependency source-map warnings only.yarn prettier --config .prettierrc --check website/src/examples/grid-layer.js website/src/examples/grid-layer.mdx website/src/examples-sidebar.js