Skip to content

feat(layers): extend WebGPU layer support#10450

Draft
ibgreen-openai wants to merge 1 commit into
ib/buffer-groupsfrom
codex/webgpu-layer-stack
Draft

feat(layers): extend WebGPU layer support#10450
ibgreen-openai wants to merge 1 commit into
ib/buffer-groupsfrom
codex/webgpu-layer-stack

Conversation

@ibgreen-openai

@ibgreen-openai ibgreen-openai commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Goals

  • Stack WebGPU layer support on top of #10151, which adds explicit WebGPU attribute buffer groups.
  • Make the website examples that have WebGPU-capable base layers selectable through the WebGPU tab.
  • Let WebGPU render supported base layers even when an application supplies WebGL-only layer extensions.
  • Keep the WebGL path as close to master as possible.

Changes

  • Added WGSL implementations and WebGPU-specific attribute/buffer paths for ArcLayer, ColumnLayer/GridCellLayer, PathLayer, SolidPolygonLayer/PolygonLayer/GeoJsonLayer, TextLayer, ScenegraphLayer, HexagonLayer's cell renderer, ScreenGridLayer's cell renderer, and BitmapLayer.
  • Kept IconLayer and TextLayer's dense instance attributes in interleaved buffer groups to stay under WebGPU vertex-buffer binding pressure.
  • HexagonLayer, ContourLayer, and ScreenGridLayer use their existing CPU aggregation paths on WebGPU, then render their sublayers with WGSL. Their WebGL GPU aggregation paths are unchanged.
  • BitmapLayer's WGSL path enables the geospatial TileLayer and WMSLayer website examples.
  • Fixed the shared WebGPU layer-pass blend state to use premultiplied-alpha over blending, correcting ArcLayer and HexagonLayer compositing without changing WebGL parameters.
  • WebGPU vertex layouts now exclude index attributes while preserving the existing separate index-buffer binding.
  • WebGPU now ignores LayerExtension shaders, attributes, and lifecycle/draw hooks; WebGL keeps the existing extension behavior.
  • Kept WebGPU-only buffer layouts, attribute types, transition disables, and render parameters behind device.type === 'webgpu' so the WebGL path remains as close to master as possible.
  • Added/updated the WebGPU support guide and wired website device tabs only for examples that passed a live WebGPU smoke test.

Website examples verified on WebGPU

Website example Main layers exercised WebGPU behavior
ArcLayer GeoJsonLayer, ArcLayer Renders flat arcs
BrushingExtension ScatterplotLayer, ArcLayer Renders; BrushingExtension is ignored
CollisionFilterExtension GeoJsonLayer, TextLayer Renders; CollisionFilterExtension is ignored
ContourLayer ContourLayer, PathLayer, SolidPolygonLayer CPU aggregation + WGSL sublayer rendering
DataFilterExtension ScatterplotLayer Renders; DataFilterExtension is ignored
GeoJsonLayer (Paths) GeoJsonLayer, PathLayer Renders paths
GeoJsonLayer (Polygons) GeoJsonLayer, SolidPolygonLayer Renders polygons
HexagonLayer HexagonLayer, HexagonCellLayer CPU aggregation + WGSL cell rendering
IconLayer IconLayer Renders icons
LineLayer LineLayer Renders lines
PointCloudLayer PointCloudLayer Renders points
ScatterplotLayer ScatterplotLayer Renders points
ScenegraphLayer ScenegraphLayer Renders glTF scenegraphs
ScreenGridLayer ScreenGridLayer, ScreenGridCellLayer CPU aggregation + WGSL cell rendering
TextLayer (Clipping) TextLayer Renders clipped text
TextLayer TextLayer Renders text; CollisionFilterExtension is ignored
TileLayer (Geospatial) TileLayer, BitmapLayer Renders raster tiles
WMSLayer _WMSLayer, BitmapLayer Renders WMS raster imagery

Validation

  • yarn build
  • yarn lint (passes with the repository's existing 70 module warnings and 18 example warnings)
  • yarn test-website
  • npx vitest run --project node test/modules/core/lib/attribute/attribute-buffer-groups.node.spec.ts (7/7)
  • yarn test-headless test/modules/layers/bitmap-layer.spec.ts test/modules/aggregation-layers/screen-grid-layer.spec.ts test/modules/aggregation-layers/screengrid-cell-layer.spec.ts test/modules/aggregation-layers/contour-layer/contour-layer.spec.ts test/modules/aggregation-layers/hexagon-layer.spec.ts (11/11)
  • yarn test-render test/render/test-cases/arc-layer.spec.ts test/render/test-cases/hexagon-layer.spec.ts test/render/test-cases/contour-layer.spec.ts test/render/test-cases/screen-grid-layer.spec.ts test/render/test-cases/path-layer.spec.ts test/render/test-cases/core-layers.spec.ts (39/39)
  • Assembled and parsed the BitmapLayer and ScreenGridLayer WGSL after the final build.
  • Live website WebGPU smoke sweep across every example in the table; no WebGPU shader, binding, or draw errors.
  • Live WebGL smoke checks for representative changed examples; no errors.

Notes

  • Extensions are intentionally no-ops on WebGPU in this PR; their visual/filtering behavior is not ported.
  • Aggregation layers use CPU fallback on WebGPU; WebGL GPU aggregation remains unchanged.
  • BitmapLayer is still documented as partial support: the geospatial TileLayer and WMSLayer examples pass, but the non-geospatial lunar Image Tile example still renders blank without a WebGPU error, so its toggle is intentionally omitted.
  • ArcLayer's verified website path is the default flat-arc path; GreatCircleLayer remains outside this support set.
  • ScenegraphLayer's external example asset can occasionally fail to fetch independently of WebGPU; its shader/render path was verified separately.

@coveralls

coveralls commented Jul 18, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 83.034%codex/webgpu-layer-stack into ib/buffer-groups. No base build found for ib/buffer-groups.

@ibgreen-openai
ibgreen-openai force-pushed the codex/webgpu-layer-stack branch from b088ab8 to b19884b Compare July 18, 2026 13:42
@ibgreen-openai
ibgreen-openai force-pushed the codex/webgpu-layer-stack branch from b19884b to bb1e679 Compare July 18, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants